• Login
Community
  • Login

Bookmark Scrollbar display

Scheduled Pinned Locked Moved General Discussion
bookmark
13 Posts 6 Posters 6.1k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J
    Justin Price
    last edited by Dec 31, 2016, 2:16 PM

    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

    S 1 Reply Last reply Dec 31, 2016, 2:48 PM Reply Quote 2
    • S
      Scott Sumner @Justin Price
      last edited by Dec 31, 2016, 2:48 PM

      @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.

      1 Reply Last reply Reply Quote 1
      • J
        Justin Price
        last edited by Dec 31, 2016, 2:57 PM

        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

        C 1 Reply Last reply Jan 1, 2017, 11:38 PM Reply Quote 1
        • C
          Claudia Frank @Justin Price
          last edited by Jan 1, 2017, 11:38 PM

          @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

          1 Reply Last reply Reply Quote 1
          • J
            Justin Price
            last edited by Jan 2, 2017, 3:20 PM

            @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.

            1 Reply Last reply Reply Quote 1
            • I
              Ilya Nenashev
              last edited by May 29, 2018, 9:29 AM

              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++!

              1 Reply Last reply Reply Quote 0
              • S
                SalviaSage
                last edited by May 29, 2018, 9:57 AM

                @Scott-Sumner

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

                S 1 Reply Last reply May 29, 2018, 12:07 PM Reply Quote 0
                • I
                  Ilya Nenashev
                  last edited by May 29, 2018, 11:23 AM

                  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.

                  1 Reply Last reply Reply Quote 0
                  • S
                    Scott Sumner @SalviaSage
                    last edited by May 29, 2018, 12:07 PM

                    @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

                    1 Reply Last reply Reply Quote 0
                    • S
                      SalviaSage
                      last edited by May 31, 2018, 11:01 PM

                      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 ???

                      ^__^

                      S 1 Reply Last reply Jun 1, 2018, 1:41 PM Reply Quote 0
                      • S
                        Scott Sumner @SalviaSage
                        last edited by Jun 1, 2018, 1:41 PM

                        @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.

                        1 Reply Last reply Reply Quote 0
                        • S
                          SalviaSage
                          last edited by SalviaSage Jun 2, 2018, 10:17 AM Jun 2, 2018, 10:16 AM

                          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

                          1 Reply Last reply Reply Quote 1
                          • A
                            Alan Kilborn
                            last edited by Dec 20, 2022, 10:50 PM

                            The marker ID used for bookmarks changed in Notepad++ 8.4.6 (and later). It is now 20, instead of 24. So, all references to 24 in this thread and/or its script(s), should be changed to 20.

                            1 Reply Last reply Reply Quote 2
                            • First post
                              Last post
                            The Community of users of the Notepad++ text editor.
                            Powered by NodeBB | Contributors