To: vim_dev@googlegroups.com Subject: Patch 8.2.3627 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.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) Files: runtime/doc/eval.txt, src/evalwindow.c, src/testdir/test_bufwintabinfo.vim *** ../vim-8.2.3626/runtime/doc/eval.txt 2021-11-18 20:47:25.814140290 +0000 --- runtime/doc/eval.txt 2021-11-20 11:03:51.726673872 +0000 *************** *** 6317,6328 **** width window width winbar 1 if the window has a toolbar, 0 otherwise ! wincol leftmost screen column of the window, ! col from |win_screenpos()| winid |window-ID| winnr window number ! winrow topmost screen column of the window, ! row from |win_screenpos()| Can also be used as a |method|: > GetWinnr()->getwininfo() --- 6380,6394 ---- width window width winbar 1 if the window has a toolbar, 0 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; ! "row" from |win_screenpos()| Can also be used as a |method|: > GetWinnr()->getwininfo() *** ../vim-8.2.3626/src/evalwindow.c 2021-11-14 11:41:27.264457621 +0000 --- src/evalwindow.c 2021-11-20 11:04:55.650591046 +0000 *************** *** 407,412 **** --- 407,413 ---- #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 *** ../vim-8.2.3626/src/testdir/test_bufwintabinfo.vim 2020-08-12 17:50:31.871655841 +0100 --- src/testdir/test_bufwintabinfo.vim 2021-11-20 11:11:42.613921429 +0000 *************** *** 50,55 **** --- 50,56 ---- only let w1_id = win_getid() + setl foldcolumn=3 new let w2_id = win_getid() tabnew | let w3_id = win_getid() *************** *** 68,73 **** --- 69,75 ---- 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) *** ../vim-8.2.3626/src/version.c 2021-11-20 10:38:17.709011550 +0000 --- src/version.c 2021-11-20 11:03:31.182698756 +0000 *************** *** 759,760 **** --- 759,762 ---- { /* Add new patch number below this line */ + /**/ + 3627, /**/ -- TIM: But follow only if you are men of valour. For the entrance to this cave is guarded by a monster, a creature so foul and cruel that no man yet has fought with it and lived. Bones of full fifty men lie strewn about its lair ... "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///