[UDL] Labels highlight In Custom Batch Doesn't Work As Expected
-
the 19th match group should be used??
regexes[(0, (252, 173, 67))] = ('^:.*$', 19)
0
is an unique id
(252, 173, 67)
is the color to be used
'^:.*$'
is the regex
19
means you want to use the 19th match group but there is none defined at all, I would expect
to see0
here. -
@Ekopalypse
I thought, 19 is something to do with Delimiter 4 (since Delimiter8 is 23, guess I mis-understood that)I just tried replacing 19 with 0 and it still doesn’t change the highlight; please see below image
-
-
@Ekopalypse Yes , yes !
Did I miss something in my setup? -
No, I don’t think so - is the name really BatchNew?
It must be exactly the same as listed in the language menu. -
@Ekopalypse
It’s actually User Defined language file - BatchNew (I tried this too, before checking for just BatchNew)
Please see below image
-
OK- then it should be BatchNew, the other stuff gets automatically added.
excluded_styles = [1, 2, 16, 17, 18, 20, 21, 22, 23]
this means that regex matches do not get colored if one of the
styles is set to the positions of the match. Maybe you wanna start with
excluded_styles = []
to see if there is something set. -
If this doesn’t work, can you post or link to the udl so that I can check this
on my side as well? -
@Ekopalypse
Yes, I kept empty brackets for ‘excluded_styles’, still no change -
gimme a sec to check it.
-
Seems to work for me
Could it be that you did the changes but haven’t restarted npp?
If so, sorry, there is no restart mechanism in the script - maybe I should add one. What I do, normally, is to edit the script, then run another instance of npp to see if the changes are good and if not, close the new instance, reedit, restart a new instance …
Not very user friendly but most of the time I only need one or two shots to make it work and see if the changes are good. -
I actually did restart several times, I suppose I did a faulty installation with the PythonScript… I’ll redo that one more time,
-
you can check if your PS installation is ok by opening the console from
Plugins->Pythonscript->Show Console
and enter something likenotepad.getPluginVersion()
in the run boxIf this works, then installation is ok.
-
I just did a new installation of the PythonScript (last time, manually through zip, this time through msi)
It’s strange, it does return the version, but it also shows other things for me
Python 2.7.6-notepad++ r2 (default, Apr 21 2014, 19:26:54) [MSC v.1600 32 bit (Intel)] Initialisation took 32ms Ready. Traceback (most recent call last): File "C:\K\OD\Stuff\Soft\Notepad++\plugins\PythonScript\scripts\EnhanceUDLLexer.py", line 260, in <module> EnhanceUDLLexer().main() File "C:\K\OD\Stuff\Soft\Notepad++\plugins\PythonScript\scripts\EnhanceUDLLexer.py", line 72, in __call__ cls._instance = super(SingletonEnhanceUDLLexer, cls).__call__(*args, **kwargs) File "C:\K\OD\Stuff\Soft\Notepad++\plugins\PythonScript\scripts\EnhanceUDLLexer.py", line 100, in __init__ self.configure() File "C:\K\OD\Stuff\Soft\Notepad++\plugins\PythonScript\scripts\EnhanceUDLLexer.py", line 179, in configure editor1.indicSetStyle(0, INDICATORSTYLE.TEXTFORE) AttributeError: type object 'INDICATORSTYLE' has no attribute 'TEXTFORE' >>> notepad.getPluginVersion() '1.0.8.0'
-
that is actually a very old version. Any particular reason
why you need to use it? What is your npp version?
Can be checked from the ? menu->Debug info. -
@Ekopalypse
Just haven’t gotten around to using the new version yet… planning for someday because mine is portable and has files mixed up inside…Please see below debug info
Notepad++ v7.6.6 (32-bit) Build time : Apr 3 2019 - 23:49:50 Path : C:\K\OD\Stuff\Soft\Notepad++\notepad++.exe Admin mode : OFF Local Conf mode : ON OS : Windows 10 (64-bit) Plugins : ColorPicker.dll ComparePlugin.dll LanguageHelp.dll mimeTools.dll NppCCompletionPlugin.dll NppConverter.dll NppExport.dll NppFavorites.dll NppFTP.dll NppJavaScript.dll NppQCP.dll NppSaveAsAdmin.dll NppSnippets.dll NppTextFX.dll PyNPP.dll PythonScript.dll RunMe.dll SearchPlus.dll SpellChecker.dll XMLTools.dll _CustomizeToolbar.dll
Edit: oh you mean the python version… this is what came with the msi
-
let’s see if we can make it work.
There are two lines here (saying two shoing four :-D )editor1.indicSetStyle(0, INDICATORSTYLE.TEXTFORE) editor1.indicSetFlags(0, SC_INDICFLAG_VALUEFORE) editor2.indicSetStyle(0, INDICATORSTYLE.TEXTFORE) editor2.indicSetFlags(0, SC_INDICFLAG_VALUEFORE)
replace
INDICATORSTYLE.TEXTFORE
by the value 17.
Hopefully this is the only missing declaration. -
@Ekopalypse :'(
editor1.indicSetStyle(0, 17) editor1.indicSetFlags(0, SC_INDICFLAG_VALUEFORE) editor2.indicSetStyle(0, 17) editor2.indicSetFlags(0, SC_INDICFLAG_VALUEFORE)
No change…
-
@Vin-dickator
is there a new error in the console? -
So, this time it says
Python 2.7.6-notepad++ r2 (default, Apr 21 2014, 19:26:54) [MSC v.1600 32 bit (Intel)] Initialisation took 32ms Ready. Traceback (most recent call last): File "C:\K\OD\Stuff\Soft\Notepad++\plugins\PythonScript\scripts\EnhanceUDLLexer.py", line 260, in <module> EnhanceUDLLexer().main() File "C:\K\OD\Stuff\Soft\Notepad++\plugins\PythonScript\scripts\EnhanceUDLLexer.py", line 72, in __call__ cls._instance = super(SingletonEnhanceUDLLexer, cls).__call__(*args, **kwargs) File "C:\K\OD\Stuff\Soft\Notepad++\plugins\PythonScript\scripts\EnhanceUDLLexer.py", line 100, in __init__ self.configure() File "C:\K\OD\Stuff\Soft\Notepad++\plugins\PythonScript\scripts\EnhanceUDLLexer.py", line 180, in configure editor1.indicSetFlags(0, SC_INDICFLAG_VALUEFORE) AttributeError: 'Editor' object has no attribute 'indicSetFlags'