diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-11-20 11:14:24 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-11-20 11:14:24 +0000 |
commit | cdf5fdb2948ecdd24c6a1e27ed33dfa847c2b3e4 (patch) | |
tree | 8e75b5a5e25c30f7bd097b8575692742907baee3 | |
parent | b8e642f7ace5382b4dacb7a8effd86f22b828cc1 (diff) | |
download | vim-git-8.2.3627.tar.gz |
patch 8.2.3627: difficult to know where the text starts in a windowv8.2.3627
Problem: difficult to know where the text starts in a window. (Sergey
Vlasov)
Solution: Add the "textoff" entry in the result of getwininfo().
(closes #9163)
-rw-r--r-- | runtime/doc/eval.txt | 3 | ||||
-rw-r--r-- | src/evalwindow.c | 1 | ||||
-rw-r--r-- | src/testdir/test_bufwintabinfo.vim | 2 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 8 insertions, 0 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 593dcb517..100301035 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -6382,6 +6382,9 @@ getwininfo([{winid}]) *getwininfo()* otherwise wincol leftmost screen column of the window; "col" from |win_screenpos()| + textoff number of columns occupied by any + 'foldcolumn', 'signcolumn' and line + number in front of the text winid |window-ID| winnr window number winrow topmost screen line of the window; diff --git a/src/evalwindow.c b/src/evalwindow.c index c90571557..c8c1442d2 100644 --- a/src/evalwindow.c +++ b/src/evalwindow.c @@ -407,6 +407,7 @@ get_win_info(win_T *wp, short tpnr, short winnr) #endif dict_add_number(dict, "width", wp->w_width); dict_add_number(dict, "wincol", wp->w_wincol + 1); + dict_add_number(dict, "textoff", win_col_off(wp)); dict_add_number(dict, "bufnr", wp->w_buffer->b_fnum); #ifdef FEAT_TERMINAL diff --git a/src/testdir/test_bufwintabinfo.vim b/src/testdir/test_bufwintabinfo.vim index f201753a2..1d8e74a0d 100644 --- a/src/testdir/test_bufwintabinfo.vim +++ b/src/testdir/test_bufwintabinfo.vim @@ -50,6 +50,7 @@ func Test_getbufwintabinfo() only let w1_id = win_getid() + setl foldcolumn=3 new let w2_id = win_getid() tabnew | let w3_id = win_getid() @@ -68,6 +69,7 @@ func Test_getbufwintabinfo() call assert_equal(winbufnr(2), winlist[1].bufnr) call assert_equal(winheight(2), winlist[1].height) call assert_equal(1, winlist[1].wincol) + call assert_equal(3, winlist[1].textoff) " foldcolumn call assert_equal(tablineheight + winheight(1) + 2, winlist[1].winrow) call assert_equal(1, winlist[2].winnr) diff --git a/src/version.c b/src/version.c index c54307e15..7bb852f52 100644 --- a/src/version.c +++ b/src/version.c @@ -758,6 +758,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 3627, +/**/ 3626, /**/ 3625, |