1
0
forked from aniani/vim

patch 8.1.1911: 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.
This commit is contained in:
Bram Moolenaar
2019-08-22 22:18:17 +02:00
parent 448262176b
commit 64b4d73524
6 changed files with 51 additions and 29 deletions

View File

@@ -3299,7 +3299,11 @@ byte2line({byte}) *byte2line()*
for the current buffer. The first character has byte count
one.
Also see |line2byte()|, |go| and |:goto|.
{not available when compiled without the |+byte_offset|
Can also be used as a |method|: >
GetOffset()->byte2line()
< {not available when compiled without the |+byte_offset|
feature}
byteidx({expr}, {nr}) *byteidx()*
@@ -3323,6 +3327,9 @@ byteidx({expr}, {nr}) *byteidx()*
If there are exactly {nr} characters the length of the string
in bytes is returned.
Can also be used as a |method|: >
GetName()->byteidx(idx)
byteidxcomp({expr}, {nr}) *byteidxcomp()*
Like byteidx(), except that a composing character is counted
as a separate character. Example: >
@@ -3336,6 +3343,9 @@ byteidxcomp({expr}, {nr}) *byteidxcomp()*
Only works different from byteidx() when 'encoding' is set to
a Unicode encoding.
Can also be used as a |method|: >
GetName()->byteidxcomp(idx)
call({func}, {arglist} [, {dict}]) *call()* *E699*
Call function {func} with the items in |List| {arglist} as
arguments.
@@ -3345,6 +3355,9 @@ call({func}, {arglist} [, {dict}]) *call()* *E699*
{dict} is for functions with the "dict" attribute. It will be
used to set the local variable "self". |Dictionary-function|
Can also be used as a |method|: >
GetFunc()->call([arg, arg], dict)
ceil({expr}) *ceil()*
Return the smallest integral value greater than or equal to
{expr} as a |Float| (round up).