Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    How to get breakpoint list ?

    Plugin Development
    3
    20
    1482
    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.
    • Gregory D.
      Gregory D. @Michael Vincent last edited by Gregory D.

      @Michael-Vincent Thank you for the code, what I don’t understand is how to turn that in c++, the functino is ::SendMessage(getCurrScintilla(), <MESSAGE>, wParam, lParam)), then I need to put pos, mask and the result in wparam and lparam, 3 parameters into 2 ?

      Michael Vincent 1 Reply Last reply Reply Quote 0
      • Gregory D.
        Gregory D. last edited by Gregory D.

        @Gregory-D said in How to get breakpoint list ?:

        long line = 0;
        int marker = 0;
        ::SendMessage(curScintilla, SCI_MARKERGET, line, (LPARAM)&marker);

        This is :

        long line = 0;
        int marker=::SendMessage(curScintilla, SCI_MARKERGET, line, 0);
        

        Right ?

        1 Reply Last reply Reply Quote 0
        • Michael Vincent
          Michael Vincent @Gregory D. last edited by Michael Vincent

          @Gregory-D

          I think maybe you’re not connecting the dots. The Scintilla docs @Alan-Kilborn linked are crucial since the Notepad++ editing component is based on Scintilla. As for “translating” my NppExec script to C++:

          [...]
          
          HWND getCurScintilla()
          {
              int which = -1;
              ::SendMessage( nppData._nppHandle, NPPM_GETCURRENTSCINTILLA, 0,
                             ( LPARAM )&which );
              return ( which == 0 ) ? nppData._scintillaMainHandle :
                     nppData._scintillaSecondHandle;
          }
          
          [...]
          int line = 0;
          int mask = 1<<24;
          SendMessage(getCurScintilla(), SCI_MARKERNEXT, line, mask);
          

          That should get you the first bookmark since N++ uses 24 as the bookmark marker and thus bitshitfted 24 is the mask the Scintilla call requires. You’ll need to put your own C++ code / logic around that to determine if you’ve found them all and how to find the next one, but again, my NppExec “pseudo” code should help you with that - as will the Scintilla docs.

          Cheers.

          Michael Vincent Gregory D. 2 Replies Last reply Reply Quote 2
          • Michael Vincent
            Michael Vincent @Michael Vincent last edited by

            @Michael-Vincent said in How to get breakpoint list ?:

            SendMessage(getCurScintilla(), SCI_MARKERNEXT, line, mask);

            sorry:

            int markerAtLine = ::SendMessage(getCurScintilla(), SCI_MARKERNEXT, line, mask);
            

            Cheers.

            1 Reply Last reply Reply Quote 1
            • Gregory D.
              Gregory D. @Michael Vincent last edited by

              @Michael-Vincent said in How to get breakpoint list ?:

              The Scintilla docs @Alan-Kilborn linked are crucial since the Notepad++ editing component is based on Scintilla. As for “translating” my NppExec script to C++:

              I’m sure about that, but what Alan Kilborn doesn’t understand is that my problem is not about Scintilla api that is documented but with the c++ conversion.
              Then right code is:

              				long line = 1;
              				int mask = (1 << 24);
              				int result=::SendMessage(curScintilla, SCI_MARKERNEXT, line, mask);
              

              You helped me, thanks.

              Michael Vincent 1 Reply Last reply Reply Quote 0
              • Michael Vincent
                Michael Vincent @Gregory D. last edited by

                @Gregory-D said in How to get breakpoint list ?:

                Then right code is:

                Yup - methinks that’s correct.

                Cheers.

                1 Reply Last reply Reply Quote 1
                • Alan Kilborn
                  Alan Kilborn last edited by Alan Kilborn

                  Tangential to the topic, but not quite off-topic:

                  I started working with an older version of Visual Studio recently, due to what is used for certain projects at work.

                  I notice that its breakpointing symbol is VERY similar to Notepad’s bookmark image, the main difference being coloring:

                  f93d525e-93a7-4a2c-9890-145ab778a422-image.png

                  In the past I’ve had a passing thought of “where did the design for the N++ bookmark come from?” as it isn’t a stock Scintilla indicator symbol like those shown HERE (with a little “scrolldown” from where that link goes).

                  Perhaps this “red” older-Visual-Studio BP symbol (shown above) was the origin of the N++ bookmark symbol.

                  The obvious stock Scintilla choice (had it been used) would have been:

                  06636eee-70c1-41af-95d2-0980fe38644f-image.png

                  BTW, current VS (2019) BP symboling is much less “fancy”; appears rather flat:

                  0142c89a-c1d3-45d0-b448-5f7675597295-image.png

                  Michael Vincent 1 Reply Last reply Reply Quote 2
                  • Michael Vincent
                    Michael Vincent @Alan Kilborn last edited by

                    @Alan-Kilborn said in How to get breakpoint list ?:

                    The obvious stock Scintilla choice (had it been used) would have been:

                    Do you have NppExec (or Python Script) that allows a script to run at startup?

                    SCI_SENDMSG SCI_MARKERDEFINE 24 SC_MARK_BOOKMARK
                    SCI_SENDMSG SCI_MARKERSETFORE 24 255
                    SCI_SENDMSG SCI_MARKERSETBACK 24 255
                    

                    (Python Scrip implementation will vary ;-)

                    51712cda-f98a-4ef9-a53f-1ff0492dc7ab-image.png

                    Cheers.

                    Alan Kilborn 1 Reply Last reply Reply Quote 4
                    • Alan Kilborn
                      Alan Kilborn @Michael Vincent last edited by

                      @Michael-Vincent

                      Yes, that is good information.
                      The Pythonscript implementation is very similar and straightforward.

                      BTW, I wasn’t complaining about Notepad++'s default bookmark symbol image in any way. Just wondering/commenting on its possible origins. It hadn’t occurred to me that the origins might be with an earlier VS version.

                      Michael Vincent 1 Reply Last reply Reply Quote 2
                      • Michael Vincent
                        Michael Vincent @Alan Kilborn last edited by

                        @Alan-Kilborn said in How to get breakpoint list ?:

                        BTW, I wasn’t complaining about Notepad++'s default bookmark symbol image in any way

                        Didn’t think you were :-) it was more of an exercise to see if I could do it. I have an NppExec ‘marker’ script that adds different colored “bookmarks” by placing normal bookmarks and then converting them. So I though it’d be possible to just change the default symbol / color.

                        Cheers.

                        1 Reply Last reply Reply Quote 3
                        • First post
                          Last post
                        Copyright © 2014 NodeBB Forums | Contributors