The setStyling doesn't work for me. I open a new editor and the console. I type some text into the editor. Then I type the following into the console:
editor.styleSetFore(9, (0,0,255))
editor.startStyling(0, 0xff)
editor.setStyling(6, 9)
But nothings happen. The editor.getStyledText returns 0 for styles.
The following code works fine:
editor.addStyledText(Cell("Hello in blue\n", ))
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm definitely new to this Scintilla thing, but I'm wondering if someone knowledgeable can give me a short course on how to do what I want to do, which is basically to programmatically (pythonscript) be able to set (and clear) highlighting sort of like the N++ Search -> "Mark..." or "Mark All" features do.
I can affect text by following the hints earlier in this thread, but I notice if I switch the active file and then come back to the file that I attempted to change the style on, my styling disappears. I'd like it to persist until I turn it off. There are other oddities I see, but this is the biggest.
Perhaps general guidance would be best! Thanks for any help in this regard!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The setStyling doesn't work for me. I open a new editor and the console. I type some text into the editor. Then I type the following into the console:
editor.styleSetFore(9, (0,0,255))
editor.startStyling(0, 0xff)
editor.setStyling(6, 9)
But nothings happen. The editor.getStyledText returns 0 for styles.
The following code works fine:
editor.addStyledText(Cell("Hello in blue\n", ))
How can I change the styling of a text?
You need to set the lexer to the container, otherwise scintilla will ignore the calls for startStyling and so on.
Cheers,
Dave.
Dear Dave,
Thank you for your incredible quick answer, it works! This plugin is awesome!
Istvan
I'm definitely new to this Scintilla thing, but I'm wondering if someone knowledgeable can give me a short course on how to do what I want to do, which is basically to programmatically (pythonscript) be able to set (and clear) highlighting sort of like the N++ Search -> "Mark..." or "Mark All" features do.
I can affect text by following the hints earlier in this thread, but I notice if I switch the active file and then come back to the file that I attempted to change the style on, my styling disappears. I'd like it to persist until I turn it off. There are other oddities I see, but this is the biggest.
Perhaps general guidance would be best! Thanks for any help in this regard!