Bookmark Scrollbar display



  • Is there a way to see where all my bookmarks are in my document. Either on the line numbers or on the scrollbar? I couldn’t find any way to do it in NP++ or a plugin.

    Thanks
    Justin



  • @Justin-Price

    It is a problem; perhaps the biggest challenge would be how to represent it in the user interface. Perhaps in the future the Document Map could have a few pixels (colored blue to match the normal bookmark symbol) in it to show where the bookmarks are, but that would maybe not be ideal as it might be so small as to be a strain on the eyes…

    As a compromise solution for myself, I have a script that keeps a section of the status bar updated with how many bookmarks I currently have set (if under a certain #), and in which direction the closest one is from the caret. Not a perfect solution, but workable for now.



  • I am thinking something like Visual Studio toolbar. This image shows red dots as break points and grey dots as bookmarks. Pretty easy to see.

    like this in VS



  • @Justin-Price

    as you said

    Either on the line numbers or on the scrollbar?

    and because line numbers would change while scrolling,
    it makes me think you have unchecked

    Settings->Preferences->Editing->Display Bookmarks

    Could this be?

    Cheers
    Claudia



  • @Claudia-Frank you are correct it makes more sense on the scrollbar than the line numbers. I do not have that setting turned off. The scrollbar shows you the whole document so it would make more sense to show them in the scrollbar like my screen shot above from Visual Studio.

    When you have multiple bookmarks on the document it would be really nice to be able to see where you are at in relation to the bookmarks on the document. This is what Visual studio allows you to see. (am i above or below my bookmark.) I know you can do that with line numbers but when you have multiple its just hard to keep track.



  • I see https://notepad-plus-plus.org/community/topic/13401/feature-request-smart-scrollbar request for this feature, but there is a strange comment and that topic is inexplicably locked.

    I feel sad because of lack of marks over scrollbar for bookmarks, search results and smart highlights.

    I extremely like this feature in Chrome (for find in a page), in Delphi with installed cnPack, in Visual Studio, and it’s my vital need to have this in Notepad++!



  • @Scott-Sumner

    I assume you will not be sharing the script which shows us how many bookmarks we have on our documents?



  • Similar request for document map panel: https://notepad-plus-plus.org/community/topic/14477/feature-requeset-show-highlighted-variables-in-document-map

    But Document map did not represent the whole document, in contradistinction to a scrollbar. And I did not find a way to zoom off it.



  • @SalviaSage said:

    I assume you will not be sharing the script which shows us how many bookmarks we have on our documents?

    Correct. It uses one of the sections of the status bar that you complained about previously regarding excessive flickering. I don’t wanna go through that again. :-D



  • Yeah but, I have already learned how to put things into the 6 different locations in the statusbar, I am planning to put it next to my file name - date last modified area, the first category.

    Give me the code?

    pretty please? with a cherry on top ???

    ^__^



  • @SalviaSage

    …cherry on top

    Haha…well, here’s something to get you going with bookmarks:

    NPP_BOOKMARK_MARKER_ID_NUMBER = 24  # from N++ source code: MARK_BOOKMARK = 24;
    NPP_BOOKMARK_MARKER_MASK = 1 << NPP_BOOKMARK_MARKER_ID_NUMBER
    
    line_nbr = editor.markerNext(0, NPP_BOOKMARK_MARKER_MASK)
    found_at_least_1 = False
    while line_nbr != -1:
        print 'bookmark found at line', str(line_nbr + 1)
        found_at_least_1 = True
        line_nbr = editor.markerNext(line_nbr + 1, NPP_BOOKMARK_MARKER_MASK)
    if not found_at_least_1:
        print 'no bookmarks found'
        if 0:
            print 'adding one at current line'
            editor.markerAdd(editor.lineFromPosition(editor.getCurrentPos()), NPP_BOOKMARK_MARKER_ID_NUMBER)
    

    The code if the if 0: block isn’t enabled but it illustrates how to add a bookmark with PS code if you ever want to do that. Otherwise the code simply prints out what lines it finds previously set bookmarks at.



  • Thanks for posting that code, I seriously need to learn the Scintilla API so I can make my own plugins and scripts. but I am pre-occupied by another scientific subject, so it’s been put on hold… : P


Log in to reply