Repository navigation
Interference between ComparePlus and EnhanceAnyLexer? Unexpected scroll on focus switch #29
Copy link
Copy link
Open
Description
Hello, and thank you for such a great plugin.
I’ve noticed an unexpected scroll down when switching focus between the two compared files. The issue disappears when I disable EnhanceAnyLexer, suggesting a conflict. Is there any fix?
Here is my current config:
; The configuration is stored in an ini-like syntax.
; The global section defines the indicator ID used for styling.
; A line starting with a semicolon is treated as a comment line, NO inline comment is supported.
; ONLY styling of the text foreground color is supported.
; Updates to the configuration are read when the file is saved and applied immediately
; when the buffer of the configured lexer is reactivated.
[global]
; The ID of the indicator used to style the matches.
; The plugin will try to request an ID from Npp, but if this fails, it will fall back to the ID configured here.
; If there are conflicts with indicators used by Npp or other plugins, change this value.
; The expected range is between 0 and 35; according to Scinitilla.
indicator_id=0
; If specifying an offset, it will affect both the start and end lines.
; For example, if the currently visible lines range from 100 to 150 and an offset=10 is given,
; the regular expressions are matched with the text from lines 90 to 160.
offset=0
; The ID of the style used to display regex errors.
; If there are conflicts with other styles used by Npp or other plugins, change this value.
; The expected range is between 0 and 255; according to Scinitilla.
regex_error_style_id=30
; The color used by the style.
; For an explanation of how this color can be defined, see the following description of the regexes and their colors.
regex_error_color=0x756ce0
; Using the RGB format instead of the default BGR format.
; The expected values are 0 (BGR) or 1 (RGB)
use_rgb_format=0
; Each configured lexer must have a section with its name,
; (NOTE: use the menu function "Enhance current language" as it takes care of the correct naming)
; followed by one or more lines with the syntax
; color[optional whitelist] = regular expression.
; A color is a number in the range 0 - 16777215.
; The notation is either pure digits or a hex notation starting with 0x or #,
; such as 0xff00ff or #ff00ff.
; Please note:
; * red goes in the lowest byte (0x0000FF)
; * green goes in the center byte (0x00FF00)
; * blue goes in the biggest byte (0xFF0000)
; * this BGR order might conflict with your expectation of RGB order.
; * see Microsoft COLORREF documentation https://docs.microsoft.com/en-us/windows/win32/gdi/colorref
; If the RGB format is to be used, set the global variable use_rgb_format=1
; The optional whitelist is expected in the form of [1,3,16 ... ] which correspond to the style IDs of the current lexer.
; A whitelist is only useful if an excluded_styles line has been configured
; and means that this regex will ignore the excluded_styles list for these IDs and apply its style.
; See excluded_styles for further information.
; The optional line of excluded_styles is expected in the form of
; excluded_styles = 1,2,3,4,5 ...
; The numbers refer to the style IDs used by the lexer and
; can be taken from the file stylers.xml or USED_THEME_NAME.xml
; and in case of UDLs the mapping is only described in the source code
; https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/lexilla/include/SciLexer.h
; starting from SCE_USER_STYLE_DEFAULT
; The regular expression syntax is explained at
; https://npp-user-manual.org/docs/searching/#regular-expressions
; For example:
;
; [markdown (preinstalled)]
; ; changes the default color - useless, just to see it works.
; 0x66ad1 = \w+
; excluded_styles = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,20,21,22,23
; [python]
; ; function parameters
; 0x66ad1 = (?:(?:def)\s\w+)\s*\(\K.+(?=\):)
; ; cls and self keywords
; 2550 = \b(cls|self)\b
; ; args and kwargs
; 0xff33ff = (\*|\*\*)\w+
; excluded_styles = 1,3,4,6,7,12,16,17,18,19
[batch]
; color each word
0x72BCC1 = (?-s).*echo\K.*
0x72BCC1 = (?-s)^set /p .*?=\K.*
0x72BCC1 = (?-s)^choice /C:.*/M.*?\K.*
; 0x6ABCDB = echo*
; check in the respective styler xml if the following IDs are valid
; excluded_styles = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,20,21,22,23
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
[-]Interfere with ComparePlus plugin[/-][+]Interference between ComparePlus and EnhanceAnyLexer? Unexpected scroll on focus switch[/+]Ekopalypse commentedon Sep 28, 2026
From the video in the ComparePlus issue, I gather that there may be a conflict regarding the indicator IDs being used. EnhancedAnyLexer asks Npp for the next available IDs and, if these are not available, falls back on the IDs specified in the configuration. If ComparePlus uses the same ones, I can imagine that something like what is shown in the video is possible. I will look into this and get back to you.