diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-08-21 22:50:07 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-08-21 22:50:07 +0200 |
commit | e49fbff384e45dd17fed72321c26937edf6de16b (patch) | |
tree | 07f2db66848b5d23b6311be43f6dc50995096d1f /runtime | |
parent | 00b0d6d8dc2c04b3cb26ea3c3d58527939f01af6 (diff) | |
download | vim-git-e49fbff384e45dd17fed72321c26937edf6de16b.tar.gz |
patch 8.1.1909: more functions can be used as methodsv8.1.1909
Problem: More functions can be used as methods.
Solution: Make a few more functions usable as a method.
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/eval.txt | 25 | ||||
-rw-r--r-- | runtime/doc/testing.txt | 9 |
2 files changed, 26 insertions, 8 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index e1f72c76b..f50cefe39 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 8.1. Last change: 2019 Aug 18 +*eval.txt* For Vim version 8.1. Last change: 2019 Aug 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2593,9 +2593,10 @@ popup_create({what}, {options}) Number create a popup window popup_dialog({what}, {options}) Number create a popup window used as a dialog popup_filter_menu({id}, {key}) Number filter for a menu popup window popup_filter_yesno({id}, {key}) Number filter for a dialog popup window +popup_findinfo() Number get window ID of info popup window +popup_findpreview() Number get window ID of preview popup window popup_getoptions({id}) Dict get options of popup window {id} popup_getpos({id}) Dict get position of popup window {id} -popup_getpreview() Number get window ID of preview popup window popup_hide({id}) none hide popup menu {id} popup_menu({what}, {options}) Number create a popup window used as a menu popup_move({id}, {options}) none set position of popup window {id} @@ -3274,17 +3275,22 @@ bufwinid({expr}) *bufwinid()* < Only deals with the current tab page. + Can also be used as a |method|: > + FindBuffer()->bufwinid() + bufwinnr({expr}) *bufwinnr()* - The result is a Number, which is the number of the first - window associated with buffer {expr}. For the use of {expr}, - see |bufname()| above. If buffer {expr} doesn't exist or - there is no such window, -1 is returned. Example: > + Like |bufwinid()| but return the window number instead of the + |window-ID|. + If buffer {expr} doesn't exist or there is no such window, -1 + is returned. Example: > echo "A window containing buffer 1 is " . (bufwinnr(1)) < The number can be used with |CTRL-W_w| and ":wincmd w" |:wincmd|. - Only deals with the current tab page. + + Can also be used as a |method|: > + FindBuffer()->bufwinnr() byte2line({byte}) *byte2line()* Return the line number that contains the character at byte @@ -9512,6 +9518,9 @@ winbufnr({nr}) The result is a Number, which is the number of the buffer Example: > :echo "The file in the current window is " . bufname(winbufnr(0)) < + Can also be used as a |method|: > + FindWindow()->winbufnr()->bufname() +< *wincol()* wincol() The result is a Number, which is the virtual column of the cursor in the window. This is counting screen cells from the @@ -9823,7 +9832,7 @@ hangul_input Compiled with Hangul input support. |hangul| hpux HP-UX version of Vim. iconv Can use iconv() for conversion. insert_expand Compiled with support for CTRL-X expansion commands in - Insert mode. + Insert mode. (always true) jumplist Compiled with |jumplist| support. keymap Compiled with 'keymap' support. lambda Compiled with |lambda| support. diff --git a/runtime/doc/testing.txt b/runtime/doc/testing.txt index 84aeb5783..f2f72bdaf 100644 --- a/runtime/doc/testing.txt +++ b/runtime/doc/testing.txt @@ -238,6 +238,10 @@ assert_equalfile({fname-one}, {fname-two}) mention that. Mainly useful with |terminal-diff|. + Can also be used as a |method|: > + GetLog()->assert_equalfile('expected.log') + + assert_exception({error} [, {msg}]) *assert_exception()* When v:exception does not contain the string {error} an error message is added to |v:errors|. Also see |assert-return|. @@ -322,10 +326,15 @@ assert_notmatch({pattern}, {actual} [, {msg}]) Can also be used as a |method|: > getFile()->assert_notmatch('bar.*') + assert_report({msg}) *assert_report()* Report a test failure directly, using {msg}. Always returns one. + Can also be used as a |method|: > + GetMessage()->assert_report() + + assert_true({actual} [, {msg}]) *assert_true()* When {actual} is not true an error message is added to |v:errors|, like with |assert_equal()|. |