]> granicus.if.org Git - vim/commitdiff
patch 8.0.1519: getchangelist() does not use argument as bufname() v8.0.1519
authorBram Moolenaar <Bram@vim.org>
Tue, 13 Feb 2018 18:21:17 +0000 (19:21 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 13 Feb 2018 18:21:17 +0000 (19:21 +0100)
Problem:    Getchangelist() does not use argument as bufname().
Solution:   Use get_buf_tv(). (Yegappan Lakshmanan, closes #2641)

src/evalfunc.c
src/testdir/test_changelist.vim
src/version.c

index daef9a8c9737efc1013b4e432df04c88c11f10ce..57929d6d79647f13c56ca836e706d86cdadae9f1 100644 (file)
@@ -4365,7 +4365,10 @@ f_getchangelist(typval_T *argvars, typval_T *rettv)
        return;
 
 #ifdef FEAT_JUMPLIST
-    buf = find_buffer(&argvars[0]);
+    (void)get_tv_number(&argvars[0]);      /* issue errmsg if type error */
+    ++emsg_off;
+    buf = get_buf_tv(&argvars[0], FALSE);
+    --emsg_off;
     if (buf == NULL)
        return;
 
index 0880fce840b26a032442323ba2ed32cf93765d82..dd6ea9600c0fa47f52432a5f7eb3e94da76b5655 100644 (file)
@@ -9,7 +9,7 @@ func Test_getchangelist()
   bwipe!
   enew
   call assert_equal([], getchangelist(10))
-  call assert_equal([[], 0], getchangelist(bufnr('%')))
+  call assert_equal([[], 0], getchangelist('%'))
 
   call writefile(['line1', 'line2', 'line3'], 'Xfile1.txt')
   call writefile(['line1', 'line2', 'line3'], 'Xfile2.txt')
@@ -23,7 +23,7 @@ func Test_getchangelist()
              \ {'lnum' : 2, 'col' : 4, 'coladd' : 0},
              \ {'lnum' : 4, 'col' : 4, 'coladd' : 0},
              \ {'lnum' : 6, 'col' : 4, 'coladd' : 0}], 2],
-             \ getchangelist(bufnr('%')))
+             \ getchangelist('%'))
 
   hide edit Xfile2.txt
   exe "normal 1GOline\<C-G>u1.0"
@@ -31,7 +31,7 @@ func Test_getchangelist()
   call assert_equal([[
              \ {'lnum' : 1, 'col' : 6, 'coladd' : 0},
              \ {'lnum' : 3, 'col' : 6, 'coladd' : 0}], 2],
-             \ getchangelist(bufnr('%')))
+             \ getchangelist('%'))
   hide enew
 
   call assert_equal([[
index 92fd162fa4632d86414852c674d848cd75d1684f..24eef2e8a155053f9cf9225f071e2099a974ac3c 100644 (file)
@@ -771,6 +771,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1519,
 /**/
     1518,
 /**/