martanne / vis

A vi-like editor based on Plan 9's structural regular expressions
Other
4.2k stars 258 forks source link

Don't center cursor line after completion #999

Open adigitoleo opened 2 years ago

adigitoleo commented 2 years ago

After inserting a completion e.g. with <C-n> in insert mode, the window is refreshed and the cursor line is centered vertically. This is distracting, and becomes an annoyance when working with split windows. Text that was previously visible in the split may be pushed out of view, forcing the user to manually readjust the view. Could the position of the cursor line relative to the window be retained in this situation?

adigitoleo commented 2 years ago

Actually, I've found that it doesn't happen all the time, but only when the cursor line is close to the bottom of the window.

Specifically, after doing zb, 2j, 2k and then typing a prefix and completing with <C-n>.