How to get Vertical Edge Settings programmatically?
-
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?
-
@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. -
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.
-
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.
:-( -
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.Maybe @donho might consider implementing a new message
NPPM_GETEDGECOLUMNS and returning an array of ints? -
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.
-
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
-
just tried it with SendMessage and I do get back 80
-
@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. -
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 -
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.