Community

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

    How to get Vertical Edge Settings programmatically?

    Plugin Development
    3
    13
    88
    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.
    • Derek Brown
      Derek Brown last edited by

      You used to be able to use SCI_GETEDGECOLUMN, but in v7.8.6 NP++ changed to using multiline mode for the vertical edge, and this message does not work with multiline mode.

      Is there a way to programmatically get the vertical edge now?

      Alan Kilborn 1 Reply Last reply Reply Quote 0
      • Alan Kilborn
        Alan Kilborn @Derek Brown last edited by

        @Derek-Brown said in How to get Vertical Edge Settings programmatically?:

        Is there a way to programmatically get the vertical edge now?

        There doesn’t appear to be; here’s the extent of the Scintilla functions regarding the vertical edge:

        SCI_SETEDGEMODE(int edgeMode)
        SCI_GETEDGEMODE → int
        SCI_SETEDGECOLUMN(position column)
        SCI_GETEDGECOLUMN → position
        SCI_SETEDGECOLOUR(colour edgeColour)
        SCI_GETEDGECOLOUR → colour
        SCI_MULTIEDGEADDLINE(position column, colour edgeColour)
        SCI_MULTIEDGECLEARALL

        I got this from HERE.

        Note that you can “add” and “clear all” for multi-edge mode, but there is no corresponding “get”.

        1 Reply Last reply Reply Quote 0
        • Derek Brown
          Derek Brown last edited by

          Yeah there’s definitely no way in the Scintilla messages. I was wondering if there was another solution that was supported, it would have to be something implemented in NP++ specifically. As a possibility, are the NP++ settings exposed to plugins in a useful way?

          Alan Kilborn 1 Reply Last reply Reply Quote 0
          • Alan Kilborn
            Alan Kilborn @Derek Brown last edited by

            @Derek-Brown said in How to get Vertical Edge Settings programmatically?:

            are the NP++ settings exposed to plugins in a useful way?

            I’m not sure about that but someone else will know.
            Even if they are exposed, I would think that this new multiple vertical edge stuff is too new to be supported yet in that way.

            May I ask what you’re really wanting to do?
            I use the single vertical edge in my setup, but I have Notepad++'s management of it completely turned off. I’m doing what I do via Pythonscript.
            I would think you could do something similar, but without knowing anything further I can’t say for sure.

            1 Reply Last reply Reply Quote 0
            • Derek Brown
              Derek Brown last edited by

              My CommentWrap plugin reads the vertical edge setting by default to decide at what column to wrap comments. This column can also be manually set, so it’s not a huge problem that it’s broken right now, but I would like to restore the functionality.

              Alan Kilborn 1 Reply Last reply Reply Quote 1
              • Alan Kilborn
                Alan Kilborn @Derek Brown last edited by

                @Derek-Brown

                Ah, okay then.
                What I do won’t help that situation.

                It does seem like a Scintilla oversight to allow setting of multiple edges without having a readback mechanism. Perhaps you want to have a look at the Scintilla issues list, maybe open an issue if there isn’t one.

                But, sadly, I suppose I am the one that broke your plugin.
                I’m sorry.
                :-(

                Ekopalypse 1 Reply Last reply Reply Quote 0
                • Ekopalypse
                  Ekopalypse @Alan Kilborn last edited by

                  Yes, there doesn’t seem to be a call which is able to get every column
                  position set but the call itself seems to report the position from the first column.

                  bfe64559-5ff0-415f-8e6c-0c3d8c2b03b6-image.png

                  Maybe @donho might consider implementing a new message
                  NPPM_GETEDGECOLUMNS and returning an array of ints?

                  1 Reply Last reply Reply Quote 0
                  • Derek Brown
                    Derek Brown last edited by Derek Brown

                    How is that call implemented? When I call in C++:

                    SendMessage(scintillaHwnd, SCI_GETEDGECOLUMN, 0, 0)
                    

                    With edges set at 80 and 120 I get back 0.

                    Ekopalypse 1 Reply Last reply Reply Quote 1
                    • Ekopalypse
                      Ekopalypse last edited by Ekopalypse

                      hmm, strange - basically doing the same as you do

                      sci.call = <SciFnDirect>SendMessageW(hwnd, SCI_GETDIRECTFUNCTION, 0, 0)
                      
                          cpdef ssize_t getEdgeColumn(self):
                              ''' Retrieve the column number which text should be kept within. '''
                              return <ssize_t>self.call(<sptr_t>self.sci_pointer, SCI_GETEDGECOLUMN, 0, 0)
                      

                      EDIT: except that I’m using the direct function

                      1 Reply Last reply Reply Quote 0
                      • Ekopalypse
                        Ekopalypse @Derek Brown last edited by

                        @Derek-Brown

                        just tried it with SendMessage and I do get back 80

                        a97b4b49-972f-4867-bc79-a0c19ce5ab1b-image.png

                        1 Reply Last reply Reply Quote 0
                        • Ekopalypse
                          Ekopalypse last edited by Ekopalypse

                          @Derek-Brown
                          WAIT - there seems to be something wrong with MY code.
                          Because I set a different value (87) and I still do get back 80.

                          1 Reply Last reply Reply Quote 0
                          • Ekopalypse
                            Ekopalypse last edited by

                            No, nothing wrong with my code but I guess there is another level of potential confusion.
                            It reports back what is configured in Number of columns

                            d318d867-d3de-4ed2-9371-a0da25f0e1d0-image.png

                            1 Reply Last reply Reply Quote 0
                            • Ekopalypse
                              Ekopalypse last edited by

                              @Derek-Brown @Alan-Kilborn

                              ok - sorry for the noise. I didn’t use the latest 7.8.6 iteration.
                              I was still running a RC version. In the final version it does what @Derek-Brown said.

                              cf91dd3a-0ff5-49df-a6a6-88df99e7d8e6-image.png

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