From 99ca9c4868bb1669706b9e3de9a9218bd11cc459 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 22 Sep 2020 21:55:41 +0200 Subject: 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 #7000) Add the "winid" argument to getcurpos(). --- runtime/doc/eval.txt | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index f0271c01dc..0853007767 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 8.2. Last change: 2020 Sep 16 +*eval.txt* For Vim version 8.2. Last change: 2020 Sep 22 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2516,7 +2516,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 @@ -5261,13 +5261,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" item 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 @@ -5478,8 +5485,9 @@ getloclist({nr} [, {what}]) *getloclist()* |location-list-file-window| for more details. - Returns an empty Dictionary if there is no location list for - the window {nr} or the window is not present. + Returns a Dictionary with default values if there is no location + list for the window {nr}. + Returns an empty Dictionary if window {nr} does not exist. Examples (See also |getqflist-examples|): > :echo getloclist(3, {'all': 0}) -- cgit v1.2.3