acejump / AceJump

🅰️ single character search, select, and jump
https://plugins.jetbrains.com/plugin/7086-acejump
GNU General Public License v3.0
1.21k stars 91 forks source link

AceJump stops highlighting the correct line after adding new lines to the file #373

Closed albrtbc closed 3 years ago

albrtbc commented 3 years ago

Describe the bug When you open a new file and use AceJump it works correctly. But if you add a new line and search again it seems like it doesn't refresh the document and highlights the words as if they were on a previous line, so it marks a line higher than it really is.

The more lines you add, the more the gap between the highlighting and the word you are looking for. In addition, everything new you add is not found.

To Reproduce Steps to reproduce the behavior:

  1. Open a file with text.
  2. Add a new line at the top of the file
  3. Search a word that's in the second line
  4. Highlights the first line

Expected behavior It should match the highlighted line with the current word.

Screenshots Here I was searching for 'aaa' which is in the second line and it's highlighting the first line. image

Desktop (please complete the following information):

Additional context Looks like it caches the file and once you write new lines / stuff it doesn't refresh it so it's always looking for the old version line.

breandan commented 3 years ago

Hi @albrtbc, thank you for reporting this issue! I am a little surprised it slipped through undetected. Indeed, it was caused by a stale cache. I have added a test and confirmed the issue is no longer present as of 3.8.1. Please feel free to give it a try and report back should you encounter any other issues.

cc: @chylex Please have a look at the fix and let me know if you have any questions or concerns.