Skip to content
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

Smart Highlighter: 5th color style doesn't work #82

Open
text-dev opened this issue Feb 25, 2020 · 5 comments
Open

Smart Highlighter: 5th color style doesn't work #82

text-dev opened this issue Feb 25, 2020 · 5 comments

Comments

@text-dev
Copy link

text-dev commented Feb 25, 2020

With Smart Highlighter enabled the 5th color style doesn't work. The styles 1th to 4th work as expected, but the color of the 5th style doesn't show in the document and the navigation bar.

Edit: Really strange behavior. I have a short CSV file with 11 lines. When I mark the comma separator with the 5th style, no color shows up. If I mark a word with 17 characters that occurs two times, the 5th style color shows up, when I put the cursor exactly at the end of the word. When I select a new line, the color disappears. The same works with styles 1th to 4th with no errors.

Notepad++ v7.8.4 (32-bit)
jN Plugin v2.2.185.5

@sieukrem
Copy link
Owner

sieukrem commented Mar 3, 2020

You are right the 5th color does not work, but it is by "design".

Smart Highlighter uses 5th color to highlight the double click selection. The "double click" selection disappeares as soon the cursor is moved.

Due to avoid strange behavior, you describe, it would be necessary to implement double click selection in native code.

@text-dev
Copy link
Author

text-dev commented Mar 4, 2020

Now I understand. I found the corresponding code in the file SmartHighlighter.js and removed it. The 5th color style now works again like the others.

But now highlight by double click only shows up for the current scroll position in the navigation bar. I guess that the 5th color style was a workaround for that. It would be great if you have the time to implement double click highlighting natively. I often need all five color style to analyze log files.

@Skrell
Copy link

Skrell commented May 24, 2023

I'm in the same boat and would love to be able to use both 5th color AND double click highlighting. Thank you!

@Skrell
Copy link

Skrell commented May 26, 2023

I wonder if there's anyway to modify the GlobalListener.addListener to receive the list of currently highlighted words and their colors.
If so, it wouldn't be hard to modify this function to make the DOUBLECLICK function create a unique color by mixing 2 of the existing smart highlighter colors such as:
MenuCmds.SEARCH_MARKALLEXT4()
MenuCmds.SEARCH_MARKALLEXT5()

Then after UNMARKING both styles upon another double click, restoring BACK the styles highlighted for previous words.
So I guess this means this function would also need a way to instruct notepad to "smart highlight" the following saved term.

Just an idea...

@Skrell
Copy link

Skrell commented Jun 1, 2023

So I was able to fix this problem by altering the notepad++ source code directly and recompiling. Now the smart-highlighting feature uses the same logic as the style-token highlighting and hence this plugin correctly picks up on the colors throughout the ENTIRE document rather than just the visible portion (this was the reason the author of this plugin used style-token#5 originally bc of this strange limitation of smart-highlighting) I plan to propose this source code change to the author of notepad++

Now as a result of my notepad++ code change you no longer need the following code:
image

However, the inactive tab (which correctly smart-highlights) does not update it's indicator panel on the side. I THINK this might be a limitation of the jN.dll plugin itself.
@sieukrem
My question is can you update this plugin so that both indicator panels graphics update? Or am I wrong in my understanding of how the graphics are updated?:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants