diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-01-06 14:04:54 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-01-06 14:04:54 +0100 |
commit | f845b87f2b3a45cbee160e28d7a3f50e54054809 (patch) | |
tree | f05dd0cf1321ca0da4e890ea3d0a41dae08e2555 /src/evalfunc.c | |
parent | 0cdb72aa38c4a0140c94d56bf8bc17cb30260ebf (diff) |
patch 8.0.0143: line number of current buffer in getbufinfo() is wrongv8.0.0143
Problem: Line number of current buffer in getbufinfo() is wrong.
Solution: For the current buffer use the current line number. (Ken Takata)
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r-- | src/evalfunc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c index 08be12bb18..f1fa7401e1 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -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); |