diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-02-06 04:46:16 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-02-06 04:46:16 +0800 |
commit | 8ba9f19961d8573dc851d3d5f2ec217ad2fb7b28 (patch) | |
tree | dcade506fff3749f5561d947067e730ca66cf126 /runtime | |
parent | 92e92f02e7106fcad1597bb8f0edf1e43186a07f (diff) | |
download | rneovim-8ba9f19961d8573dc851d3d5f2ec217ad2fb7b28.tar.gz rneovim-8ba9f19961d8573dc851d3d5f2ec217ad2fb7b28.tar.bz2 rneovim-8ba9f19961d8573dc851d3d5f2ec217ad2fb7b28.zip |
vim-patch:8.2.1727: a popup created with "cursorline" will ignore "firstline"
Problem: A popup created with "cursorline" will ignore "firstline".
Solution: When both "cursorline" and "firstline" are present put the cursor
on "firstline". (closes vim/vim#7000) Add the "winid" argument to
getcurpos().
https://github.com/vim/vim/commit/99ca9c4868bb1669706b9e3de9a9218bd11cc459
Skip popup window related code.
Cherry-pick all of Test_getcurpos_setpos() from patch 8.2.0610.
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/builtin.txt | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 327b8dc4d9..4f6104c602 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -178,7 +178,7 @@ getcmdtype() String return current command-line type getcmdwintype() String return current command-line window type getcompletion({pat}, {type} [, {filtered}]) List list of cmdline completion matches -getcurpos() List position of the cursor +getcurpos([{winnr}]) List position of the cursor getcwd([{winnr} [, {tabnr}]]) String get the current working directory getenv({name}) String return environment variable getfontname([{name}]) String name of font being used @@ -2786,13 +2786,20 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()* GetPattern()->getcompletion('color') < *getcurpos()* -getcurpos() Get the position of the cursor. This is like getpos('.'), but +getcurpos([{winid}]) + Get the position of the cursor. This is like getpos('.'), but includes an extra "curswant" in the list: [0, lnum, col, off, curswant] ~ The "curswant" number is the preferred column when moving the cursor vertically. Also see |getpos()|. The first "bufnum" item is always zero. + The optional {winid} argument can specify the window. It can + be the window number or the |window-ID|. The last known + cursor position is returned, this may be invalid for the + current value of the buffer if it is not the current window. + If {winid} is invalid a list with zeroes is returned. + This can be used to save and restore the cursor position: > let save_cursor = getcurpos() MoveTheCursorAround |