Is my Code Folding interfering with Change History and therefore producing orange lines
-
Hello dear community,
my SQL Formatter plugin SQLinForm is creating orange background when a SQL has been formatted.
I know that the “code change” feature has been introduced a while ago and I can avoid these orange lines by de-activating the change history, but I would really like to have this option activated and I am investigating how I could avoid the orange lines (see screenshot). Could this be related to the fact that I am creating a code folding bar right next to the line numbers and that this is interfering with the change hisrtory feature?Regards
GuidoMarcel -
Is your plugin setting the Change History margin to zero-width? That’s one way that the change indication will be shown in the background coloring of the text, rather than only in a margin.
-
Could this be related to the fact that I am creating a code folding bar right next to the line numbers and that this is interfering with the change hisrtory feature?
To elaborate what @Alan-Kilborn said, you can read Scintilla’s “official” explanation here:
The background colour over the whole line occurs because there is no margin to show the marker and the backup method is to show the marker over the text. This may also occur for bookmarks and breakpoints.
See this thread for an earlier report of this issue.
-
@Guido-Thelen said in Is my Code Folding interfering with Change History and therefore producing orange lines:
Could this be related to the fact that I am creating a code folding bar right next to the line numbers and that this is interfering with the change hisrtory feature?
Yes it could be. Notepad++ already has a code folding margin. The Notepad++ margins in use are:
- Line numbers
- Bookmarks (and hide lines markers)
- Change History (Scintilla feature)
- Code folding margin
The 3. Code folding margin is not always present due to some languages not supporting folding. The “Normal Text” default file type for Notepad++ for example does not have this margin showing, but it still exists (0 width).
If you’re adding your own code folding margin, you should use a margin that is not already in use by Notepad++ (
SCI_GETMARGINS
). Additionally, when you set the margin mask (SCI_SETMARGINMASKN
), make sure to not use any of the markers allocated for Change History (21 - 24) or those in use by Notepad++ (17 - 20). Note that other plugins may use markers as well so there may be other conflicts, but that’s more out of your control than the Scintilla and Notepad++ ones.Cheers.
-
@Michael-Vincent Dear Michael-Vincent
many thanks for your perfect explanation. I got it working now. Both, the change history and the code folding are now working fne. Will soon make the new release available.
Regards
Guido -
@Alan-Kilborn Hi Alan, many thanks for your reply. Got it working now
Regards
Guido -
@rdipardo Hi, many thanks for your answer. Got it working now :-)
-
@Guido-Thelen said in Is my Code Folding interfering with Change History and therefore producing orange lines:
Dear Michael-Vincent
many thanks for your perfect explanation. I got it working now.I don’t know about “perfect”, but glad it helped. Thank you for continuing the support of your plugin as Notepad++ gains new features and keeps pace with Scintilla updates. It’s an arduous process, but as you can see form this forum, there are many users who I’m sure appreciate your work.
Cheers.