Closed asaning closed 7 months ago
Could you provide a video with visible key press (by using software like carnac) to describe your problem?
Uploading 01.mp4…
我回到第一个tab的时候, 鼠标回到了最后一行, 我想光标回到那个之前的位置
AFAIK this is currently impossible bc all registers can only store positions that actually exist in the file (that is, before \<EOF>). In other words, it can't preserve extra window scrolls beyond \<EOF>. But in other cases, nvim should work as expected since we've set up the corresponding option and autocmd:
*'startofline'* *'sol'* *'nostartofline'* *'nosol'*
'startofline' 'sol' boolean (default off)
global
When "on" the commands listed below move the cursor to the first
non-blank of the line. When off the cursor is kept in the same column
(if possible). This applies to the commands: CTRL-D, CTRL-U, CTRL-B,
CTRL-F, "G", "H", "M", "L", gg, and to the commands "d", "<<" and ">>"
with a linewise operator, with "%" with a count and to buffer changing
commands (CTRL-^, :bnext, :bNext, etc.). Also for an Ex command that
only has a line number, e.g., ":25" or ":+".
In case of buffer changing commands the cursor is placed at the column
where it was the last time the buffer was edited.
actually the cursor is at the same position, it's at line 83 all the time. ... and @Jint-lzxy had said the rest loool, he typed tooo fast!
the main reason is the you scroll beyond the end of file, aka \<EOF>. it's more like a visual effect, rather than actual cursor position.
Feature description
1 , i use the
zz
command to get the current line to relocate the middle of screen , 2, i switch to another tab, when i return back the previous one, the cursor doesn't locate in the right positionit's common in the coding process, when the code extend the one screen. each time i should relocate the cursor, it's annoying
Additional information
No response