diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2021-08-07 17:53:43 +0100 |
---|---|---|
committer | Sean Dewar <seandewar@users.noreply.github.com> | 2021-08-12 22:35:24 +0100 |
commit | 7925f0b6330c18c9391d02f844cd17b41fbb3d2e (patch) | |
tree | 17519697c8de6e7a8c0154c9a16333c282f219da /runtime | |
parent | 5fbc1a49c719c0c93fa73277ac30d17f797d096d (diff) | |
download | rneovim-7925f0b6330c18c9391d02f844cd17b41fbb3d2e.tar.gz rneovim-7925f0b6330c18c9391d02f844cd17b41fbb3d2e.tar.bz2 rneovim-7925f0b6330c18c9391d02f844cd17b41fbb3d2e.zip |
vim-patch:8.1.1909: more functions can be used as methods
Problem: More functions can be used as methods.
Solution: Make a few more functions usable as a method.
https://github.com/vim/vim/commit/e49fbff384e45dd17fed72321c26937edf6de16b
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/eval.txt | 17 | ||||
-rw-r--r-- | runtime/doc/testing.txt | 8 |
2 files changed, 20 insertions, 5 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 511d072366..5754742c6d 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2929,18 +2929,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 @@ -9619,6 +9623,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 diff --git a/runtime/doc/testing.txt b/runtime/doc/testing.txt index fc841dfc9c..3b59dfa908 100644 --- a/runtime/doc/testing.txt +++ b/runtime/doc/testing.txt @@ -83,6 +83,9 @@ assert_equalfile({fname-one}, {fname-two}) When {fname-one} or {fname-two} does not exist the error will mention that. + 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|. @@ -172,10 +175,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()|. |