patch 8.1.1915: more functions can be used as methods

Problem:    More functions can be used as methods.
Solution:   Make various functions usable as a method.
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 14fc6df..b5e98f4 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -494,16 +494,16 @@
     {"ch_status",	1, 2, FEARG_1,	  f_ch_status},
 #endif
     {"changenr",	0, 0, 0,	  f_changenr},
-    {"char2nr",		1, 2, 0,	  f_char2nr},
-    {"chdir",		1, 1, 0,	  f_chdir},
-    {"cindent",		1, 1, 0,	  f_cindent},
-    {"clearmatches",	0, 1, 0,	  f_clearmatches},
-    {"col",		1, 1, 0,	  f_col},
-    {"complete",	2, 2, 0,	  f_complete},
-    {"complete_add",	1, 1, 0,	  f_complete_add},
+    {"char2nr",		1, 2, FEARG_1,	  f_char2nr},
+    {"chdir",		1, 1, FEARG_1,	  f_chdir},
+    {"cindent",		1, 1, FEARG_1,	  f_cindent},
+    {"clearmatches",	0, 1, FEARG_1,	  f_clearmatches},
+    {"col",		1, 1, FEARG_1,	  f_col},
+    {"complete",	2, 2, FEARG_2,	  f_complete},
+    {"complete_add",	1, 1, FEARG_1,	  f_complete_add},
     {"complete_check",	0, 0, 0,	  f_complete_check},
-    {"complete_info",	0, 1, 0,	  f_complete_info},
-    {"confirm",		1, 4, 0,	  f_confirm},
+    {"complete_info",	0, 1, FEARG_1,	  f_complete_info},
+    {"confirm",		1, 4, FEARG_1,	  f_confirm},
     {"copy",		1, 1, FEARG_1,	  f_copy},
 #ifdef FEAT_FLOAT
     {"cos",		1, 1, FEARG_1,	  f_cos},
@@ -511,16 +511,16 @@
 #endif
     {"count",		2, 4, FEARG_1,	  f_count},
     {"cscope_connection",0,3, 0,	  f_cscope_connection},
-    {"cursor",		1, 3, 0,	  f_cursor},
+    {"cursor",		1, 3, FEARG_1,	  f_cursor},
 #ifdef MSWIN
-    {"debugbreak",	1, 1, 0,	  f_debugbreak},
+    {"debugbreak",	1, 1, FEARG_1,	  f_debugbreak},
 #endif
-    {"deepcopy",	1, 2, 0,	  f_deepcopy},
-    {"delete",		1, 2, 0,	  f_delete},
-    {"deletebufline",	2, 3, 0,	  f_deletebufline},
+    {"deepcopy",	1, 2, FEARG_1,	  f_deepcopy},
+    {"delete",		1, 2, FEARG_1,	  f_delete},
+    {"deletebufline",	2, 3, FEARG_1,	  f_deletebufline},
     {"did_filetype",	0, 0, 0,	  f_did_filetype},
-    {"diff_filler",	1, 1, 0,	  f_diff_filler},
-    {"diff_hlID",	2, 2, 0,	  f_diff_hlID},
+    {"diff_filler",	1, 1, FEARG_1,	  f_diff_filler},
+    {"diff_hlID",	2, 2, FEARG_1,	  f_diff_hlID},
     {"empty",		1, 1, FEARG_1,	  f_empty},
     {"environ",		0, 0, 0,	  f_environ},
     {"escape",		2, 2, 0,	  f_escape},
diff --git a/src/testdir/test_bufline.vim b/src/testdir/test_bufline.vim
index 6d62e51..183a186 100644
--- a/src/testdir/test_bufline.vim
+++ b/src/testdir/test_bufline.vim
@@ -132,7 +132,7 @@
   call assert_equal(0, deletebufline(b, 2, 8))
   call assert_equal(['aaa'], getbufline(b, 1, 2))
   exe "bd!" b
-  call assert_equal(1, deletebufline(b, 1))
+  call assert_equal(1, b->deletebufline(1))
 
   call assert_equal(1, deletebufline(-1, 1))
 
diff --git a/src/testdir/test_cd.vim b/src/testdir/test_cd.vim
index 3185954..e0dedfb 100644
--- a/src/testdir/test_cd.vim
+++ b/src/testdir/test_cd.vim
@@ -85,7 +85,7 @@
   call assert_equal('y', fnamemodify(getcwd(1, 2), ':t'))
   call assert_equal('z', fnamemodify(getcwd(3, 2), ':t'))
   tabnext | wincmd t
-  call chdir('..')
+  eval '..'->chdir()
   call assert_equal('Xdir', fnamemodify(getcwd(1, 2), ':t'))
   call assert_equal('Xdir', fnamemodify(getcwd(2, 2), ':t'))
   call assert_equal('z', fnamemodify(getcwd(3, 2), ':t'))
diff --git a/src/testdir/test_cindent.vim b/src/testdir/test_cindent.vim
index a8a2345..e12e457 100644
--- a/src/testdir/test_cindent.vim
+++ b/src/testdir/test_cindent.vim
@@ -121,9 +121,9 @@
   new
   setlocal cindent
   call setline(1, ['int main(void)', '{', 'return 0;', '}'])
-  call assert_equal(cindent(0), -1)
-  call assert_equal(cindent(3), &sw)
-  call assert_equal(cindent(line('$')+1), -1)
+  call assert_equal(-1, cindent(0))
+  call assert_equal(&sw, 3->cindent())
+  call assert_equal(-1, cindent(line('$')+1))
   bwipe!
 endfunc
 
diff --git a/src/testdir/test_cursor_func.vim b/src/testdir/test_cursor_func.vim
index 0f638b3..fbe7be7 100644
--- a/src/testdir/test_cursor_func.vim
+++ b/src/testdir/test_cursor_func.vim
@@ -22,7 +22,7 @@
   call cursor(3, 0)
   call assert_equal([3, 1, 0, 1], getcurpos()[1:])
   " below last line goes to last line
-  call cursor(9, 1)
+  eval [9, 1]->cursor()
   call assert_equal([4, 1, 0, 1], getcurpos()[1:])
 
   call setline(1, ["\<TAB>"])
diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim
index 027cdc8..bbdbfb8 100644
--- a/src/testdir/test_diffmode.vim
+++ b/src/testdir/test_diffmode.vim
@@ -674,7 +674,7 @@
   call diff_hlID(1, 2)->synIDattr("name")->assert_equal("DiffText")
   call diff_hlID(2, 1)->synIDattr("name")->assert_equal("")
   call diff_hlID(3, 1)->synIDattr("name")->assert_equal("DiffAdd")
-  call diff_hlID(4, 1)->synIDattr("name")->assert_equal("")
+  eval 4->diff_hlID(1)->synIDattr("name")->assert_equal("")
 
   wincmd w
   call assert_equal(synIDattr(diff_hlID(1, 1), "name"), "DiffChange")
@@ -693,7 +693,7 @@
   diffthis
   redraw
 
-  call assert_equal([0, 0, 0, 0, 0, 0, 0, 1, 0], map(range(-1, 7), 'diff_filler(v:val)'))
+  call assert_equal([0, 0, 0, 0, 0, 0, 0, 1, 0], map(range(-1, 7), 'v:val->diff_filler()'))
   wincmd w
   call assert_equal([0, 0, 0, 0, 2, 0, 0, 0], map(range(-1, 6), 'diff_filler(v:val)'))
 
diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim
index 6f65ae0..7a3d054 100644
--- a/src/testdir/test_functions.vim
+++ b/src/testdir/test_functions.vim
@@ -1078,7 +1078,7 @@
   call assert_equal(7, col('$'))
   call assert_equal(4, col("'x"))
   call assert_equal(6, col("'Y"))
-  call assert_equal(2, col([1, 2]))
+  call assert_equal(2, [1, 2]->col())
   call assert_equal(7, col([1, '$']))
 
   call assert_equal(0, col(''))
@@ -1413,7 +1413,7 @@
   call assert_equal(1, a)
 
   call feedkeys('y', 'L')
-  let a = confirm('Are you sure?', "&Yes\n&No")
+  let a = 'Are you sure?'->confirm("&Yes\n&No")
   call assert_equal(1, a)
 
   call feedkeys('n', 'L')
@@ -1514,7 +1514,7 @@
   let files = readdir('Xdir', {x -> len(add(l, x)) == 2 ? -1 : 1})
   call assert_equal(1, len(files))
 
-  call delete('Xdir', 'rf')
+  eval 'Xdir'->delete('rf')
 endfunc
 
 func Test_delete_rf()
@@ -1548,6 +1548,7 @@
 
 func Test_char2nr()
   call assert_equal(12354, char2nr('あ', 1))
+  call assert_equal(120, 'x'->char2nr())
 endfunc
 
 func Test_eventhandler()
diff --git a/src/testdir/test_match.vim b/src/testdir/test_match.vim
index db87914..0bc1863 100644
--- a/src/testdir/test_match.vim
+++ b/src/testdir/test_match.vim
@@ -215,7 +215,7 @@
         \]
   call assert_equal(expect, savematches)
 
-  call clearmatches(winid)
+  eval winid->clearmatches()
   call assert_equal([], getmatches(winid))
 
   call setmatches(savematches, winid)
diff --git a/src/testdir/test_method.vim b/src/testdir/test_method.vim
index 8c5f35b..69adc30 100644
--- a/src/testdir/test_method.vim
+++ b/src/testdir/test_method.vim
@@ -8,6 +8,7 @@
   eval l->assert_notequal([3, 2, 1])
   eval l->assert_notequal([3, 2, 1], 'wrong')
   call assert_equal(l, l->copy())
+  call assert_equal(l, l->deepcopy())
   call assert_equal(1, l->count(2))
   call assert_false(l->empty())
   call assert_true([]->empty())
@@ -38,6 +39,7 @@
   let d = #{one: 1, two: 2, three: 3}
 
   call assert_equal(d, d->copy())
+  call assert_equal(d, d->deepcopy())
   call assert_equal(1, d->count(2))
   call assert_false(d->empty())
   call assert_true({}->empty())
diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim
index 6c86d69..5b602cc 100644
--- a/src/testdir/test_popup.vim
+++ b/src/testdir/test_popup.vim
@@ -250,7 +250,7 @@
 
 func Test_noinsert_complete()
   func! s:complTest1() abort
-    call complete(1, ['source', 'soundfold'])
+    eval ['source', 'soundfold']->complete(1)
     return ''
   endfunc
 
@@ -403,7 +403,7 @@
     return 0
   else
     call complete_add('four1')
-    call complete_add('four2')
+    eval 'four2'->complete_add()
     call complete_check()
     call complete_add('four3')
     call complete_add('four4')
@@ -993,7 +993,7 @@
   if empty(g:compl_what)
     let g:compl_info = complete_info()
   else
-    let g:compl_info = complete_info(g:compl_what)
+    let g:compl_info = g:compl_what->complete_info()
   endif
   return ''
 endfunc
diff --git a/src/version.c b/src/version.c
index 020a11b..8ece6f1 100644
--- a/src/version.c
+++ b/src/version.c
@@ -762,6 +762,8 @@
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1915,
+/**/
     1914,
 /**/
     1913,