Menu

Bookmarks?

2013-10-16
2013-10-16
  • Rob Johansen

    Rob Johansen - 2013-10-16

    I am trying to write a plugin. This maybe a really stupid question, but I can't seem to find how to bookmark a line. I started with NppPlugin.NET.v0.6.
    The best I could come up with was Markers?
    So I tried:
    Win32.SendMessage(Npp.CurrentScintilla, SciMsg.SCI_MARKERADD, lineNumber, (int)SciMsg.SC_MARK_CIRCLE);
    I also tried passing in integers 1-3.
    Nothing.
    I added
    Win32.SendMessage(Npp.CurrentScintilla, SciMsg.SCI_SETMARGINMASKN, 1, (int)~SciMsg.SC_MASK_FOLDERS);
    And that got me little white splotches (jagged circles), regardless of marker number I passed in, and they did not appear to be a bookmark.

    I also ran across the IDM_SEARCH_TOGGLE_BOOKMARK Menu command, but that appears to require me to actually set each line to bookmark as the current line and then bookmark it (Haven't actually tried this yet)

    What am I missing?

     
  • Rob Johansen

    Rob Johansen - 2013-10-16

    Found the answer. I downloaded the NPP source code and found out that it uses SCI_MARKERADD with a value of 24. Even calls the constant "MARK_BOOKMARK"
    Oddly, the NppPlugin.NET template names 24 "SC_MARK_ARROWS".
    Changed my code to use 24, and Bookmarks!

     

Log in to post a comment.