t9md / atom-narrow

narrow something
https://atom.io/packages/narrow
MIT License
109 stars 12 forks source link

search provider position lost when source edited #298

Closed dwelle closed 6 years ago

dwelle commented 6 years ago

steps:

  1. search for something in search provider
  2. you go line by line in search provider, notice a line to be refactored
  3. when you change the line in source editor which removes the line in narrow search, it resets the cursor position back to top

what should happen:

The search provider should put the cursor on the closest next (or previous) line to the one being removed.


Narrow 0.65.0, Win7, Atom 1.26.1

dwelle commented 6 years ago

Can't repro anymore.. will re-open if persists.

dwelle commented 6 years ago

Got it.. it happens not when you just remove match, but if you remove all matches for given file. Then the cursor in search UI is reset to top.

t9md commented 6 years ago

If you remove all matches for given file, moving to top is OK. What do you expect in this scenario? I need more detailed example, number of files, each content of files, search word input, "refactoring" you do to reproduce issues... and so on..

t9md commented 6 years ago

I think I get what you wanted to report, but it's not fixable with technical reason. There is NO closest item when originally-cursor-placed-file are removed, narrow-editor is not tracking order of item(no previous/next file tracking). In ag/rg result, ouput are retrieves in separate chunks and asynchronously. So no order(which file comes after which file) are pre-determined. It might change on each search. That's why we cannot decide which is the closest file when all cursor-placed-file's-items are removed.

dwelle commented 6 years ago

I see, thanks anyway :)