forked from aniani/vim
patch 8.1.1953: more functions can be used as a method
Problem: More functions can be used as a method. Solution: Allow more functions to be used as a method.
This commit is contained in:
@@ -5774,6 +5774,9 @@ haslocaldir([{winnr} [, {tabnr}]]) *haslocaldir()*
|
||||
" tab page m
|
||||
:echo haslocaldir(-1, m)
|
||||
<
|
||||
Can also be used as a |method|: >
|
||||
GetWinnr()->haslocaldir()
|
||||
|
||||
hasmapto({what} [, {mode} [, {abbr}]]) *hasmapto()*
|
||||
The result is a Number, which is 1 if there is a mapping that
|
||||
contains {what} in somewhere in the rhs (what it is mapped to)
|
||||
@@ -5802,6 +5805,9 @@ hasmapto({what} [, {mode} [, {abbr}]]) *hasmapto()*
|
||||
< This installs the mapping to "\ABCdoit" only if there isn't
|
||||
already a mapping to "\ABCdoit".
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetRHS()->hasmapto()
|
||||
|
||||
histadd({history}, {item}) *histadd()*
|
||||
Add the String {item} to the history {history} which can be
|
||||
one of: *hist-names*
|
||||
@@ -5823,6 +5829,10 @@ histadd({history}, {item}) *histadd()*
|
||||
:let date=input("Enter date: ")
|
||||
< This function is not available in the |sandbox|.
|
||||
|
||||
Can also be used as a |method|, the base is used for the
|
||||
second argument: >
|
||||
GetPattern()->histadd('search')
|
||||
|
||||
histdel({history} [, {item}]) *histdel()*
|
||||
Clear {history}, i.e. delete all its entries. See |hist-names|
|
||||
for the possible values of {history}.
|
||||
@@ -5854,6 +5864,9 @@ histdel({history} [, {item}]) *histdel()*
|
||||
the "n" command and 'hlsearch': >
|
||||
:call histdel("search", -1)
|
||||
:let @/ = histget("search", -1)
|
||||
<
|
||||
Can also be used as a |method|: >
|
||||
GetHistory()->histdel()
|
||||
|
||||
histget({history} [, {index}]) *histget()*
|
||||
The result is a String, the entry with Number {index} from
|
||||
@@ -5870,6 +5883,9 @@ histget({history} [, {index}]) *histget()*
|
||||
the {num}th entry from the output of |:history|. >
|
||||
:command -nargs=1 H execute histget("cmd", 0+<args>)
|
||||
<
|
||||
Can also be used as a |method|: >
|
||||
GetHistory()->histget()
|
||||
|
||||
histnr({history}) *histnr()*
|
||||
The result is the Number of the current entry in {history}.
|
||||
See |hist-names| for the possible values of {history}.
|
||||
@@ -5877,6 +5893,9 @@ histnr({history}) *histnr()*
|
||||
|
||||
Example: >
|
||||
:let inp_index = histnr("expr")
|
||||
|
||||
< Can also be used as a |method|: >
|
||||
GetHistory()->histnr()
|
||||
<
|
||||
hlexists({name}) *hlexists()*
|
||||
The result is a Number, which is non-zero if a highlight group
|
||||
@@ -5887,6 +5906,9 @@ hlexists({name}) *hlexists()*
|
||||
*highlight_exists()*
|
||||
Obsolete name: highlight_exists().
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetName()->hlexists()
|
||||
<
|
||||
*hlID()*
|
||||
hlID({name}) The result is a Number, which is the ID of the highlight group
|
||||
with name {name}. When the highlight group doesn't exist,
|
||||
@@ -5898,6 +5920,9 @@ hlID({name}) The result is a Number, which is the ID of the highlight group
|
||||
< *highlightID()*
|
||||
Obsolete name: highlightID().
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetName()->hlID()
|
||||
|
||||
hostname() *hostname()*
|
||||
The result is a String, which is the name of the machine on
|
||||
which Vim is currently running. Machine names greater than
|
||||
@@ -5922,6 +5947,9 @@ iconv({expr}, {from}, {to}) *iconv()*
|
||||
from/to UCS-2 is automatically changed to use UTF-8. You
|
||||
cannot use UCS-2 in a string anyway, because of the NUL bytes.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetText()->iconv('latin1', 'utf-8')
|
||||
<
|
||||
*indent()*
|
||||
indent({lnum}) The result is a Number, which is indent of line {lnum} in the
|
||||
current buffer. The indent is counted in spaces, the value
|
||||
@@ -5929,6 +5957,8 @@ indent({lnum}) The result is a Number, which is indent of line {lnum} in the
|
||||
|getline()|.
|
||||
When {lnum} is invalid -1 is returned.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetLnum()->indent()
|
||||
|
||||
index({object}, {expr} [, {start} [, {ic}]]) *index()*
|
||||
If {object} is a |List| return the lowest index where the item
|
||||
@@ -5949,6 +5979,8 @@ index({object}, {expr} [, {start} [, {ic}]]) *index()*
|
||||
:let idx = index(words, "the")
|
||||
:if index(numbers, 123) >= 0
|
||||
|
||||
< Can also be used as a |method|: >
|
||||
GetObject()->index(what)
|
||||
|
||||
input({prompt} [, {text} [, {completion}]]) *input()*
|
||||
The result is a String, which is whatever the user typed on
|
||||
@@ -5995,6 +6027,9 @@ input({prompt} [, {text} [, {completion}]]) *input()*
|
||||
: call inputrestore()
|
||||
:endfunction
|
||||
|
||||
< Can also be used as a |method|: >
|
||||
GetPrompt()->input()
|
||||
|
||||
inputdialog({prompt} [, {text} [, {cancelreturn}]]) *inputdialog()*
|
||||
Like |input()|, but when the GUI is running and text dialogs
|
||||
are supported, a dialog window pops up to input the text.
|
||||
@@ -6009,6 +6044,9 @@ inputdialog({prompt} [, {text} [, {cancelreturn}]]) *inputdialog()*
|
||||
<Esc> works like pressing the Cancel button.
|
||||
NOTE: Command-line completion is not supported.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetPrompt()->inputdialog()
|
||||
|
||||
inputlist({textlist}) *inputlist()*
|
||||
{textlist} must be a |List| of strings. This |List| is
|
||||
displayed, one string per line. The user will be prompted to
|
||||
@@ -6025,6 +6063,9 @@ inputlist({textlist}) *inputlist()*
|
||||
let color = inputlist(['Select color:', '1. red',
|
||||
\ '2. green', '3. blue'])
|
||||
|
||||
< Can also be used as a |method|: >
|
||||
GetChoices()->inputlist()
|
||||
|
||||
inputrestore() *inputrestore()*
|
||||
Restore typeahead that was saved with a previous |inputsave()|.
|
||||
Should be called the same number of times inputsave() is
|
||||
@@ -6050,6 +6091,9 @@ inputsecret({prompt} [, {text}]) *inputsecret()*
|
||||
typed on the command-line in response to the issued prompt.
|
||||
NOTE: Command-line completion is not supported.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetPrompt()->inputsecret()
|
||||
|
||||
insert({object}, {item} [, {idx}]) *insert()*
|
||||
When {object} is a |List| or a |Blob| insert {item} at the start
|
||||
of it.
|
||||
@@ -6083,6 +6127,9 @@ isdirectory({directory}) *isdirectory()*
|
||||
exist, or isn't a directory, the result is |FALSE|. {directory}
|
||||
is any expression, which is used as a String.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetName()->isdirectory()
|
||||
|
||||
isinf({expr}) *isinf()*
|
||||
Return 1 if {expr} is a positive infinity, or -1 a negative
|
||||
infinity, otherwise 0. >
|
||||
@@ -6109,6 +6156,9 @@ islocked({expr}) *islocked()* *E786*
|
||||
< When {expr} is a variable that does not exist you get an error
|
||||
message. Use |exists()| to check for existence.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetName()->islocked()
|
||||
|
||||
isnan({expr}) *isnan()*
|
||||
Return |TRUE| if {expr} is a float with value NaN. >
|
||||
echo isnan(0.0 / 0.0)
|
||||
|
||||
Reference in New Issue
Block a user