]> granicus.if.org Git - vim/commitdiff
patch 8.0.0143: line number of current buffer in getbufinfo() is wrong v8.0.0143
authorBram Moolenaar <Bram@vim.org>
Fri, 6 Jan 2017 13:04:54 +0000 (14:04 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 6 Jan 2017 13:04:54 +0000 (14:04 +0100)
Problem:    Line number of current buffer in getbufinfo() is wrong.
Solution:   For the current buffer use the current line number. (Ken Takata)

src/evalfunc.c
src/version.c

index 08be12bb181060edd77be20288543e18cefb5ee7..f1fa7401e1528facae1eb99fdbb25b85baee1f33 100644 (file)
@@ -3973,7 +3973,8 @@ get_buffer_info(buf_T *buf)
     dict_add_nr_str(dict, "bufnr", buf->b_fnum, NULL);
     dict_add_nr_str(dict, "name", 0L,
            buf->b_ffname != NULL ? buf->b_ffname : (char_u *)"");
-    dict_add_nr_str(dict, "lnum", buflist_findlnum(buf), NULL);
+    dict_add_nr_str(dict, "lnum", buf == curbuf ? curwin->w_cursor.lnum
+                                               : buflist_findlnum(buf), NULL);
     dict_add_nr_str(dict, "loaded", buf->b_ml.ml_mfp != NULL, NULL);
     dict_add_nr_str(dict, "listed", buf->b_p_bl, NULL);
     dict_add_nr_str(dict, "changed", bufIsChanged(buf), NULL);
index 4ee83cd4acbf153a37e462c9110216755a116358..d4224cbdbd7bb91d55b4af0a7daec9cc6ab430a4 100644 (file)
@@ -764,6 +764,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    143,
 /**/
     142,
 /**/