yi-editor / yi

The Haskell-Scriptable Editor
GNU General Public License v2.0
1.51k stars 200 forks source link

Vim: Search next doesn't show up if search result is on last line of view #653

Open ghost opened 9 years ago

ghost commented 9 years ago

Using vty, while searching, if on using n for jump to next result, if the search result is on the last line of the view, it does not get displayed correctly. The line above the search result is displayed on the last line instead.

Fuuzetsu commented 9 years ago

Does it happen in pango?

ghost commented 9 years ago

Will try pango soon and let you know. On further investigation, looks like this only happens if the line is towards the end, like, the third last line in my case.

ghost commented 9 years ago

Similar issue in pango. I noticed the line went above the current view in pango.

And, I noticed this happening on lines throughout the file, so it's not specific to the last few lines.

jhance commented 9 years ago

If the first result for the search is the last line, does the same bug occur? Or is it only with "n"?

The main reason I ask is that "n" goes to a continueVimSearch while "/" is basically initSearch <...> >>= continueVimSearch

Also I'm having trouble replicating. I put a search term on the last line, and on the second line, hit gg, did search, then n, and the last line was shown.

ghost commented 9 years ago

@jhance it happens even for the first result

I find it difficult to reproduce it myself. You could try opening this file (https://github.com/OOW/bigpicture/blob/7e21b9b3f0ee35a9f8640058d2313e8438df0cd7/ui.R), and keeping a window size of approx 80x14, use gg/fixedRow(column(1 and check if you can see the result. However, pressing enter after that, or using gg/fixedRow(column(12 should show you the result on the last line. Hopefully, that should be reproducible.

ethercrow commented 9 years ago

Does it correlate with the presence of wrapped lines on screen?

On Thu, Oct 23, 2014 at 7:25 AM, Siddhanathan Shanmugam < notifications@github.com> wrote:

@jhance https://github.com/jhance it happens even for the first result

I find it difficult to reproduce it myself. You could try opening this file ( https://github.com/OOW/bigpicture/blob/7e21b9b3f0ee35a9f8640058d2313e8438df0cd7/ui.R), and keeping a window size of approx 80x14, use gg/fixedRow(column(1 and check if you can see the result. However, pressing enter after that, or using gg/fixedRow(column(12 should show you the result on the last line. Hopefully, that should be reproducible.

— Reply to this email directly or view it on GitHub https://github.com/yi-editor/yi/issues/653#issuecomment-60176700.

ghost commented 9 years ago

@ethercrow I guess it is. Maybe it's related to the bug that waynr is trying to fix right now.

jhance commented 9 years ago

Did this get resolved by waynr's patches?

ghost commented 9 years ago

I don't think so. I had a similar issue on current master.