diff runtime/doc/eval.txt @ 13379:0f9dd1b43244

patch 8.0.1563: timeout of getwinposx() can be too short commit https://github.com/vim/vim/commit/3f54fd319f6641b4bed478bcc90cdb39ede68e31 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Mar 3 21:29:55 2018 +0100 patch 8.0.1563: timeout of getwinposx() can be too short Problem: Timeout of getwinposx() can be too short. (lilydjwg) Solution: Add getwinpos(). (closes https://github.com/vim/vim/issues/2689)
author Christian Brabandt <cb@256bit.org>
date Sat, 03 Mar 2018 21:30:06 +0100
parents acd7eaa13d2b
children 02b3f719eacb
line wrap: on
line diff
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -2192,8 +2192,9 @@ gettabvar({nr}, {varname} [, {def}])
 gettabwinvar({tabnr}, {winnr}, {name} [, {def}])
 				any	{name} in {winnr} in tab page {tabnr}
 getwininfo([{winid}])		List	list of windows
-getwinposx()			Number	X coord in pixels of GUI Vim window
-getwinposy()			Number	Y coord in pixels of GUI Vim window
+getwinpos([{tmeout}])		List	X and Y coord in pixels of the Vim window
+getwinposx()			Number	X coord in pixels of the Vim window
+getwinposy()			Number	Y coord in pixels of the Vim window
 getwinvar({nr}, {varname} [, {def}])
 				any	variable {varname} in window {nr}
 glob({expr} [, {nosuf} [, {list} [, {alllinks}]]])
@@ -4878,16 +4879,24 @@ gettabwinvar({tabnr}, {winnr}, {varname}
 			:let list_is_on = gettabwinvar(1, 2, '&list')
 			:echo "myvar = " . gettabwinvar(3, 1, 'myvar')
 <
+getwinpos([{timeout}])					*getwinpos()*
+		The result is a list with two numbers, the result of
+		getwinposx() and getwinposy() combined: 
+			[x-pos, y-pos]
+		{timeout} can be used to specify how long to wait in msec for
+		a response from the terminal.  When omitted 100 msec is used.
+
 							*getwinposx()*
 getwinposx()	The result is a Number, which is the X coordinate in pixels of
 		the left hand side of the GUI Vim window. Also works for an
-		xterm.
+		xterm (uses a timeout of 100 msec).
 		The result will be -1 if the information is not available.
 		The value can be used with `:winpos`.
 
 							*getwinposy()*
 getwinposy()	The result is a Number, which is the Y coordinate in pixels of
-		the top of the GUI Vim window.  Also works for an xterm.
+		the top of the GUI Vim window.  Also works for an xterm (uses
+		a timeout of 100 msec).
 		The result will be -1 if the information is not available.
 		The value can be used with `:winpos`.