sieukrem / jn-npp-plugin

Plugin for Notepad++ allowing you to automate some tasks using JavaScript
https://github.com/sieukrem/jn-npp-plugin/wiki
109 stars 24 forks source link

Spurious markers near the vertical scroll bars for smart highlighting #123

Closed mahaju closed 1 year ago

mahaju commented 1 year ago

Describe the bug When opening a large document vertical scrollbars show locations of highlighted words, even though I have not highlighted anything yet

To Reproduce

  1. Open a large document
  2. Do not highlight anything, just use the vertical scrollbar to scroll through the document
  3. Position of highlighted words start appearing next to the vertical scroll bars, even though I have not highlighted anything
  4. Once I highlight a word, positions of the highlighted words start appearing along side the spurious markers previously explained; unhighlighting the word makes its markers disappear, but the spurious markers remain

This happens randomly for me and I don't have an exact way to reproduce this, but whenever it does happen the steps mentioned above will produce it. I also usually have a large number of tabs open, although I am not sure if this is relevant.

Expected behavior The markers next to the vertical scrollbar should only appear when I highlight words, and should disappear when I unhighlight them.

Screenshots This is when I just open this large document. image

I do not highlight any word, but just scroll down clicking and dragging the scroll bar image

I highlight a frequently occurring word image

I unhighlight the frequently occuring word image

Is this a bug or is there a setting I need to change? I only use the jN plugin for the smart highlighting feature so I don't know any details about the plugin settings. I have kept everything at their default.

Environment

image

image

sieukrem commented 1 year ago

It seems to be a bug. Can you please check with latest release

mahaju commented 1 year ago

I updated with the latest release [renamed the old jN folder to jN.2.2.185.6, copied everything in jN_2.2.185.9_x64.zip to a new jN folder inside "C:\Program Files\Notepad++\plugins"]

The problem is still happening The markers seem to be thicker this time Again, this happens randomly and it's happening (sometimes) in some files and not happening in others For example, here is a .kt file with no word highlighted: image I have another .kt file open that behaves normally. I don't know what is the difference between the two .kt files.

I will revert back to the older jN version for now, because I prefer the thinner markers. Let me know if you would like me to test something else.

Could this be related to file extension or file size?

mahaju commented 1 year ago

I was looking at the "smart highlighter" settings image and I noticed that if I uncheck all the boxes, all smart highlighting markers go away, both legitimate and spurious. Could changing anything here get rid of the spurious markers? Do you have any documents that explain what the 32 options are?

Seems this is something related to the "SmartHighlighter.js" file in C:\Program Files\Notepad++\plugins\jN\jN\includes, but I don't know any javascript. Some document explaining what the 32 options are (all I could figure out is it seems to be some kind of bit mask) would be helpful, if these settings are relevant to getting rid of the spurious markers.

naaitsab commented 1 year ago

Looks to be related to specific document content. Tested some random files in the same session. Works fine: log, xml, txt, js, psc and new unsaved file (new 1) Issue: toml When I copy the text content from the toml file to one of the files that works as normal it shows the exact same issue as the toml file and what the OP references to. When I delete the text again on all open documents that have it in, it reverts to normal. If I leave the text in one of the documents it shows the black bars at random when selecting the file in the tab of N++

The toml file content for reference: Link as the content gets mangled

sieukrem commented 1 year ago

I could reproduce the issue!

  1. URLs in documents are using indicator 9 and are black, these are spurious markers, which appear als when nothing is selected. Just unselect the indicator 9 in Smart Highlighter Settings
  2. There is a bug in jN which was uncovered through behavior change somewhen after N++ version v7.xx. Switching from huge documents to smaller lead to left overs in the indicator panel. I will push a fix soon.
sieukrem commented 1 year ago

Please check the latest release!

mahaju commented 1 year ago

@sieukrem Here are some of my findings:

  1. URLs are indeed causing the spurious markers. Unselecting indicator 9 removes them.
  2. Using latest release, I get the same effect I mentioned previously at https://github.com/sieukrem/jn-npp-plugin/issues/123#issuecomment-1683490967 that is, spurious markers still appear, but all markers are now thicker

Since I prefer thinner markers, for now the best solution for me is to just uncheck indicator 9

Would you mind sharing any documents explaining what the different indicators are and what they do?