diff runtime/doc/eval.txt @ 17930:0cdb6ac20748 v8.1.1961

patch 8.1.1961: more functions can be used as a method Commit: https://github.com/vim/vim/commit/a1449836334355b1fb00cd1bf083e7d353f6c4d7 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 1 20:16:52 2019 +0200 patch 8.1.1961: 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. Add a test for mapcheck().
author Bram Moolenaar <Bram@vim.org>
date Sun, 01 Sep 2019 20:30:04 +0200
parents 2e53305f2239
children 6d11a0d5751d
line wrap: on
line diff
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -6699,6 +6699,8 @@ maparg({name} [, {mode} [, {abbr} [, {di
 		mapped, and have it do the original mapping too.  Sketch: >
 			exe 'nnoremap <Tab> ==' . maparg('<Tab>', 'n')
 
+<		Can also be used as a |method|: >
+			GetKey()->maparg('n')
 
 mapcheck({name} [, {mode} [, {abbr}]])			*mapcheck()*
 		Check if there is a mapping that matches with {name} in mode
@@ -6733,6 +6735,9 @@ mapcheck({name} [, {mode} [, {abbr}]])		
 <		This avoids adding the "_vv" mapping when there already is a
 		mapping for "_v" or for "_vvv".
 
+		Can also be used as a |method|: >
+			GetKey()->mapcheck('n')
+
 match({expr}, {pat} [, {start} [, {count}]])			*match()*
 		When {expr} is a |List| then this returns the index of the
 		first item where {pat} matches.  Each item is used as a
@@ -6791,6 +6796,9 @@ match({expr}, {pat} [, {start} [, {count
 		the pattern.  'smartcase' is NOT used.  The matching is always
 		done like 'magic' is set and 'cpoptions' is empty.
 
+		Can also be used as a |method|: >
+			GetList()->match('word')
+<
 				*matchadd()* *E798* *E799* *E801* *E957*
 matchadd({group}, {pattern} [, {priority} [, {id} [, {dict}]]])
 		Defines a pattern to be highlighted in the current window (a
@@ -6846,6 +6854,9 @@ matchadd({group}, {pattern} [, {priority
 		available from |getmatches()|.  All matches can be deleted in
 		one operation by |clearmatches()|.
 
+		Can also be used as a |method|: >
+			GetGroup()->matchadd('TODO')
+<
 							*matchaddpos()*
 matchaddpos({group}, {pos} [, {priority} [, {id} [, {dict}]]])
 		Same as |matchadd()|, but requires a list of positions {pos}
@@ -6880,6 +6891,9 @@ matchaddpos({group}, {pos} [, {priority}
 		|getmatches()| with an entry "pos1", "pos2", etc., with the
 		value a list like the {pos} item.
 
+		Can also be used as a |method|: >
+			GetGroup()->matchaddpos([23, 11])
+
 matcharg({nr})							*matcharg()*
 		Selects the {nr} match item, as set with a |:match|,
 		|:2match| or |:3match| command.
@@ -6892,6 +6906,9 @@ matcharg({nr})							*matcharg()*
 		Highlighting matches using the |:match| commands are limited
 		to three matches. |matchadd()| does not have this limitation.
 
+		Can also be used as a |method|: >
+			GetMatch()->matcharg()
+
 matchdelete({id} [, {win})		       *matchdelete()* *E802* *E803*
 		Deletes a match with ID {id} previously defined by |matchadd()|
 		or one of the |:match| commands.  Returns 0 if successful,
@@ -6900,6 +6917,9 @@ matchdelete({id} [, {win})		       *matc
 		If {win} is specified, use the window with this number or
 		window ID instead of the current window.
 
+		Can also be used as a |method|: >
+			GetMatch()->matchdelete()
+
 matchend({expr}, {pat} [, {start} [, {count}]])			*matchend()*
 		Same as |match()|, but return the index of first character
 		after the match.  Example: >
@@ -6919,6 +6939,9 @@ matchend({expr}, {pat} [, {start} [, {co
 <		result is "-1".
 		When {expr} is a |List| the result is equal to |match()|.
 
+		Can also be used as a |method|: >
+			GetText()->matchend('word')
+
 matchlist({expr}, {pat} [, {start} [, {count}]])		*matchlist()*
 		Same as |match()|, but return a |List|.  The first item in the
 		list is the matched string, same as what matchstr() would
@@ -6929,6 +6952,9 @@ matchlist({expr}, {pat} [, {start} [, {c
 <		Results in: ['acd', 'a', '', 'c', 'd', '', '', '', '', '']
 		When there is no match an empty list is returned.
 
+		Can also be used as a |method|: >
+			GetList()->matchlist('word')
+
 matchstr({expr}, {pat} [, {start} [, {count}]])			*matchstr()*
 		Same as |match()|, but return the matched string.  Example: >
 			:echo matchstr("testing", "ing")
@@ -6942,6 +6968,9 @@ matchstr({expr}, {pat} [, {start} [, {co
 		When {expr} is a |List| then the matching item is returned.
 		The type isn't changed, it's not necessarily a String.
 
+		Can also be used as a |method|: >
+			GetText()->matchstr('word')
+
 matchstrpos({expr}, {pat} [, {start} [, {count}]])		*matchstrpos()*
 		Same as |matchstr()|, but return the matched string, the start
 		position and the end position of the match.  Example: >
@@ -6960,6 +6989,8 @@ matchstrpos({expr}, {pat} [, {start} [, 
 <		result is ["x", 1, 2, 3].
 		The type isn't changed, it's not necessarily a String.
 
+		Can also be used as a |method|: >
+			GetText()->matchstrpos('word')
 							*max()*
 max({expr})	Return the maximum value of all items in {expr}.
 		{expr} can be a list or a dictionary.  For a dictionary,
@@ -7010,6 +7041,9 @@ mkdir({name} [, {path} [, {prot}]])
 
 		Not available on all systems.  To check use: >
 			:if exists("*mkdir")
+
+<		Can also be used as a |method|: >
+			GetName()->mkdir()
 <
 							*mode()*
 mode([expr])	Return a string that indicates the current mode.
@@ -7055,6 +7089,9 @@ mode([expr])	Return a string that indica
 		the leading character(s).
 		Also see |visualmode()|.
 
+		Can also be used as a |method|: >
+			DoFull()->mode()
+
 mzeval({expr})							*mzeval()*
 		Evaluate MzScheme expression {expr} and return its result
 		converted to Vim data structures.
@@ -7070,6 +7107,9 @@ mzeval({expr})							*mzeval()*
 		    :echo mzeval("l")
 		    :echo mzeval("h")
 <
+		Can also be used as a |method|: >
+			GetExpr()->mzeval()
+<
 		{only available when compiled with the |+mzscheme| feature}
 
 nextnonblank({lnum})					*nextnonblank()*