Mercurial > vim
comparison runtime/doc/eval.txt @ 9221:17fa362f10be v7.4.1894
commit https://github.com/vim/vim/commit/511972d810ea490955161ff5097ec2f57919ceaf
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jun 4 18:09:59 2016 +0200
patch 7.4.1894
Problem: Cannot get the window ID for a mouse click.
Solution: Add v:mouse_winid.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 04 Jun 2016 18:15:05 +0200 |
parents | 7363f5cc4cb8 |
children | 6c4d610fce0a |
comparison
equal
deleted
inserted
replaced
9220:29a8841b4025 | 9221:17fa362f10be |
---|---|
1 *eval.txt* For Vim version 7.4. Last change: 2016 May 25 | 1 *eval.txt* For Vim version 7.4. Last change: 2016 Jun 04 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
1356 v:beval_winnr The number of the window, over which the mouse pointer is. Only | 1356 v:beval_winnr The number of the window, over which the mouse pointer is. Only |
1357 valid while evaluating the 'balloonexpr' option. The first | 1357 valid while evaluating the 'balloonexpr' option. The first |
1358 window has number zero (unlike most other places where a | 1358 window has number zero (unlike most other places where a |
1359 window gets a number). | 1359 window gets a number). |
1360 | 1360 |
1361 *v:beval_winid* *beval_winid-variable* | |
1362 v:beval_winid The window ID of the window, over which the mouse pointer is. | |
1363 Otherwise like v:beval_winnr. | |
1364 | |
1361 *v:char* *char-variable* | 1365 *v:char* *char-variable* |
1362 v:char Argument for evaluating 'formatexpr' and used for the typed | 1366 v:char Argument for evaluating 'formatexpr' and used for the typed |
1363 character when using <expr> in an abbreviation |:map-<expr>|. | 1367 character when using <expr> in an abbreviation |:map-<expr>|. |
1364 It is also used by the |InsertCharPre| and |InsertEnter| events. | 1368 It is also used by the |InsertCharPre| and |InsertEnter| events. |
1365 | 1369 |
1588 | 1592 |
1589 *v:mouse_win* *mouse_win-variable* | 1593 *v:mouse_win* *mouse_win-variable* |
1590 v:mouse_win Window number for a mouse click obtained with |getchar()|. | 1594 v:mouse_win Window number for a mouse click obtained with |getchar()|. |
1591 First window has number 1, like with |winnr()|. The value is | 1595 First window has number 1, like with |winnr()|. The value is |
1592 zero when there was no mouse button click. | 1596 zero when there was no mouse button click. |
1597 | |
1598 *v:mouse_winid* *mouse_winid-variable* | |
1599 v:mouse_winid Window ID for a mouse click obtained with |getchar()|. | |
1600 The value is zero when there was no mouse button click. | |
1593 | 1601 |
1594 *v:mouse_lnum* *mouse_lnum-variable* | 1602 *v:mouse_lnum* *mouse_lnum-variable* |
1595 v:mouse_lnum Line number for a mouse click obtained with |getchar()|. | 1603 v:mouse_lnum Line number for a mouse click obtained with |getchar()|. |
1596 This is the text line number, not the screen line number. The | 1604 This is the text line number, not the screen line number. The |
1597 value is zero when there was no mouse button click. | 1605 value is zero when there was no mouse button click. |
1819 terminal and Vim connects to the X server (|-X|) this will be | 1827 terminal and Vim connects to the X server (|-X|) this will be |
1820 set to the window ID. | 1828 set to the window ID. |
1821 When an MS-Windows GUI is running this will be set to the | 1829 When an MS-Windows GUI is running this will be set to the |
1822 window handle. | 1830 window handle. |
1823 Otherwise the value is zero. | 1831 Otherwise the value is zero. |
1824 Note: for windows inside Vim use |winnr()|. | 1832 Note: for windows inside Vim use |winnr()| or |win_getid()|. |
1825 | 1833 |
1826 ============================================================================== | 1834 ============================================================================== |
1827 4. Builtin Functions *functions* | 1835 4. Builtin Functions *functions* |
1828 | 1836 |
1829 See |function-list| for a list grouped by what the function is used for. | 1837 See |function-list| for a list grouped by what the function is used for. |
3844 | 3852 |
3845 Use getcharmod() to obtain any additional modifiers. | 3853 Use getcharmod() to obtain any additional modifiers. |
3846 | 3854 |
3847 When the user clicks a mouse button, the mouse event will be | 3855 When the user clicks a mouse button, the mouse event will be |
3848 returned. The position can then be found in |v:mouse_col|, | 3856 returned. The position can then be found in |v:mouse_col|, |
3849 |v:mouse_lnum| and |v:mouse_win|. This example positions the | 3857 |v:mouse_lnum|, |v:mouse_winid| and |v:mouse_win|. This |
3850 mouse as it would normally happen: > | 3858 example positions the mouse as it would normally happen: > |
3851 let c = getchar() | 3859 let c = getchar() |
3852 if c == "\<LeftMouse>" && v:mouse_win > 0 | 3860 if c == "\<LeftMouse>" && v:mouse_win > 0 |
3853 exe v:mouse_win . "wincmd w" | 3861 exe v:mouse_win . "wincmd w" |
3854 exe v:mouse_lnum | 3862 exe v:mouse_lnum |
3855 exe "normal " . v:mouse_col . "|" | 3863 exe "normal " . v:mouse_col . "|" |
4722 Returns a String with the status of {job}: | 4730 Returns a String with the status of {job}: |
4723 "run" job is running | 4731 "run" job is running |
4724 "fail" job failed to start | 4732 "fail" job failed to start |
4725 "dead" job died or was stopped after running | 4733 "dead" job died or was stopped after running |
4726 | 4734 |
4735 On Unix a non-existing command results in "dead" instead of | |
4736 "fail", because a fork happens before the failure can be | |
4737 detected. | |
4738 | |
4727 If an exit callback was set with the "exit_cb" option and the | 4739 If an exit callback was set with the "exit_cb" option and the |
4728 job is now detected to be "dead" the callback will be invoked. | 4740 job is now detected to be "dead" the callback will be invoked. |
4729 | 4741 |
4730 For more information see |job_info()|. | 4742 For more information see |job_info()|. |
4731 | 4743 |
6367 |getqflist()| returns. | 6379 |getqflist()| returns. |
6368 | 6380 |
6369 *E927* | 6381 *E927* |
6370 If {action} is set to 'a', then the items from {list} are | 6382 If {action} is set to 'a', then the items from {list} are |
6371 added to the existing quickfix list. If there is no existing | 6383 added to the existing quickfix list. If there is no existing |
6372 list, then a new list is created. If {action} is set to 'r', | 6384 list, then a new list is created. |
6373 then the items from the current quickfix list are replaced | 6385 |
6374 with the items from {list}. If {action} is not present or is | 6386 If {action} is set to 'r', then the items from the current |
6375 set to ' ', then a new list is created. | 6387 quickfix list are replaced with the items from {list}. This |
6388 can also be used to clear the list: > | |
6389 :call setqflist([], 'r') | |
6390 < | |
6391 If {action} is not present or is set to ' ', then a new list | |
6392 is created. | |
6376 | 6393 |
6377 Returns zero for success, -1 for failure. | 6394 Returns zero for success, -1 for failure. |
6378 | 6395 |
6379 This function can be used to create a quickfix list | 6396 This function can be used to create a quickfix list |
6380 independent of the 'errorformat' setting. Use a command like | 6397 independent of the 'errorformat' setting. Use a command like |