To: vim_dev@googlegroups.com Subject: Patch 8.1.1656 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.1656 Problem: Popup window width is wrong when using Tabs. (Paul Jolly) Solution: Count tabs correctly. (closes #4637) Files: src/popupwin.c, src/testdir/test_popupwin.vim, src/testdir/dumps/Test_popupwin_11.dump *** ../vim-8.1.1655/src/popupwin.c 2019-07-07 20:43:28.641704359 +0200 --- src/popupwin.c 2019-07-09 20:21:39.812791370 +0200 *************** *** 880,886 **** wp->w_width = 1; for (lnum = wp->w_topline; lnum <= wp->w_buffer->b_ml.ml_line_count; ++lnum) { ! int len = vim_strsize(ml_get_buf(wp->w_buffer, lnum, FALSE)); if (wp->w_p_wrap) { --- 880,888 ---- wp->w_width = 1; for (lnum = wp->w_topline; lnum <= wp->w_buffer->b_ml.ml_line_count; ++lnum) { ! // count Tabs for what they are worth ! int len = win_linetabsize(wp, ml_get_buf(wp->w_buffer, lnum, FALSE), ! (colnr_T)MAXCOL); if (wp->w_p_wrap) { *** ../vim-8.1.1655/src/testdir/test_popupwin.vim 2019-07-08 23:30:03.618603190 +0200 --- src/testdir/test_popupwin.vim 2019-07-09 20:17:55.365784524 +0200 *************** *** 225,231 **** \ '#include ', \ 'int main(void)', \ '{', ! \ ' printf(567);', \ '}', \], {'line': 3, 'col': 21, 'highlight': 'PopupColor'}) call setbufvar(winbufnr(winid), '&syntax', 'cpp') --- 225,231 ---- \ '#include ', \ 'int main(void)', \ '{', ! \ "\tprintf(567);", \ '}', \], {'line': 3, 'col': 21, 'highlight': 'PopupColor'}) call setbufvar(winbufnr(winid), '&syntax', 'cpp') *** ../vim-8.1.1655/src/testdir/dumps/Test_popupwin_11.dump 2019-05-30 18:40:20.120405138 +0200 --- src/testdir/dumps/Test_popupwin_11.dump 2019-07-09 20:19:34.785344867 +0200 *************** *** 1,10 **** >1+0&#ffffff0| @73 |2| @73 ! |3| @18|#+0#e000e06#e0e0e08|i|n|c|l|u|d|e| |<+0#e000002&|s|t|d|i|o|.|h|>| +0#0000000#ffffff0@36 ! |4| @18|i+0#00e0003#e0e0e08|n|t| +0#0000000&|m|a|i|n|(|v+0#00e0003&|o|i|d|)+0#0000000&| @3| +0&#ffffff0@36 ! |5| @18|{+0&#e0e0e08| @16| +0&#ffffff0@36 ! |6| @18| +0&#e0e0e08@3|p|r|i|n|t|f|(|5+0#e000002&|6|7|)+0#0000000&|;| @1| +0&#ffffff0@36 ! |7| @18|}+0&#e0e0e08| @16| +0&#ffffff0@36 |8| @73 |9| @73 @57|1|,|1| @10|T|o|p| --- 1,10 ---- >1+0&#ffffff0| @73 |2| @73 ! |3| @18|#+0#e000e06#e0e0e08|i|n|c|l|u|d|e| |<+0#e000002&|s|t|d|i|o|.|h|>| +0#0000000&@1| +0&#ffffff0@34 ! |4| @18|i+0#00e0003#e0e0e08|n|t| +0#0000000&|m|a|i|n|(|v+0#00e0003&|o|i|d|)+0#0000000&| @5| +0&#ffffff0@34 ! |5| @18|{+0&#e0e0e08| @18| +0&#ffffff0@34 ! |6| @18| +0&#e0e0e08@7|p|r|i|n|t|f|(|5+0#e000002&|6|7|)+0#0000000&|;| +0&#ffffff0@34 ! |7| @18|}+0&#e0e0e08| @18| +0&#ffffff0@34 |8| @73 |9| @73 @57|1|,|1| @10|T|o|p| *** ../vim-8.1.1655/src/version.c 2019-07-08 23:30:03.618603190 +0200 --- src/version.c 2019-07-09 20:22:24.620592878 +0200 *************** *** 779,780 **** --- 779,782 ---- { /* Add new patch number below this line */ + /**/ + 1656, /**/ -- Q: How many hardware engineers does it take to change a lightbulb? A: None. We'll fix it in software. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///