-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notepad++ v8.4 and beyond (inclusive 8.4.2) CRASHES or doesn't work properly when applying a color on selected text using NppExec. #69
Comments
Thank you for this detailed bug report!
and it everything works for me for both 64-bit and 32-bit Notepad++ 8.4.2. |
The crash is caused by NppHorizontalRuler, assuming it was compiled from this source tree. It uses the length returned by
The developer of NppHorizontalRuler should be notfied with a link to notepad-plus-plus/notepad-plus-plus#11766 |
Hello, As suggested by @rdipardo on the bug report of notepad++ I tried a recent development build with only the NppExec plugin installed and no other plugin and it still didn't work as expected. So when you say "everything works for me for both 64-bit and 32-bit Notepad++ 8.4.2" are you sure that you have at the same time the highlighting of selected text in both tabs like in version 8.3.3 ? |
Only the active view has the selected text in green: i.e. when the primary view is active, its selected text foreground color is green; when the secondary view is active, its selected text foreground color is green. |
Well I tried this in Notepad++ 8.4.2 with NppExec 0.8.2 : SCI_SENDMSG SCI_SETELEMENTCOLOUR 1 65280 And unfortunately it does not work, SCI_SETSELFORE 1 65280 works the same way as SCI_SENDMSG 2067 1 65280 But SCI_SETELEMENTCOLOUR does not seem to work at all in the intended way. |
This works:
|
There is one catch — you must turn off DirectWrite: The new APIs were designed to support alpha channels. The officially correct usage is:
With
It makes no difference when GDI rendering is active (as per the default), but DirectWrite will read a 24-bit RGB value as having a 0 alpha byte:
|
Notepad++ v8.4 and beyond (inclusive 8.4.2) CRASHES or doesn't work properly when applying a color on selected text using NppExec.
In notepad++v8.3.3 everything works fine but when I wanted to upgrade to notepad++v8.4 and beyond Notepad++ went unstable and did not work as usual.
I always use two views, meaning I have text files open on two columns.
I want to have my selected text to be "GREEN on BLACK", therefore I have implemented NppExec with following script :
SCI_SENDMSG 2067 1 65280
This sets globally the foreground color to green fro selected text.
Although this initialization only works for one of the views (the active one at startup time) when I start notepad++, thus I always have also to apply it manually on the second view which does not have the focus at startup.
Now this worked perfectly well in v8.3.3 where I could have both views with selected text displayed "GREEN on BLACK".
But when I updated to v8.4 or beyond this did not work anymore.
I still had to execute the second NppExec command manually on the second view, but each time I lose the focus on one view the selected text returns to the default higlighting and more problematic notepad++ now very often just CRASHES when doing so !
Steps to Reproduce the Issue
Expected Behavior
As in v8.3.3 I expect the selected text to remain highlighted in both views in "GREEN on BLACK", and more importantly notepad++ should not CRASH as this happens very frequently with v8.4 and beyond !
Actual Behavior
With v8.4 and beyond changing the focus to one view reverts the other view to the default highlighting for selected text, and it makes notepad++ CRASH very frequently.
In fact it CRASHES so often I had to reinstall v8.3.3 !
Debug Information
NppExec script
WORKING VERSION
Notepad++ v8.3.3 (64-bit)
Build time : Mar 13 2022 - 17:20:02
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line :
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 10 Enterprise (64-bit)
OS Version : 2009
OS Build : 19044.1706
Current ANSI codepage : 1252
Plugins : DSpellCheck.dll mimeTools.dll NppConverter.dll NppExec.dll NppExport.dll NppHorizontalRuler.dll
PROBLEMATIC VERSION
Notepad++ v8.4 (64-bit)
Build time : Apr 20 2022 - 03:31:06
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line :
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 10 Enterprise (64-bit)
OS Version : 2009
OS Build : 19044.1706
Current ANSI codepage : 1252
Plugins : DSpellCheck.dll mimeTools.dll NppConverter.dll NppExec.dll NppExport.dll NppHorizontalRuler.dll
Unfortunately even with the latest version of NppExec it does not work, maybe it crashes a bit less often but that's it, when losing the focus it still reverts to the default highlighting instead of applying the one from the script.
The text was updated successfully, but these errors were encountered: