comparison src/popupwin.c @ 17442:57b9fca8c7d2 v8.1.1719

patch 8.1.1719: popup too wide when 'showbreak' is set commit https://github.com/vim/vim/commit/331bafd481fddfe542099d8cccd38d240c10c011 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jul 20 17:46:05 2019 +0200 patch 8.1.1719: popup too wide when 'showbreak' is set Problem: Popup too wide when 'showbreak' is set. Solution: Set window width when computing line length. (closes https://github.com/vim/vim/issues/4701)
author Bram Moolenaar <Bram@vim.org>
date Sat, 20 Jul 2019 18:00:07 +0200
parents a5874fdc8f3a
children 74b6674b99fd
comparison
equal deleted inserted replaced
17441:b50d3687f31c 17442:57b9fca8c7d2
969 // text. 969 // text.
970 // TODO: more accurate wrapping 970 // TODO: more accurate wrapping
971 wp->w_width = 1; 971 wp->w_width = 1;
972 for (lnum = wp->w_topline; lnum <= wp->w_buffer->b_ml.ml_line_count; ++lnum) 972 for (lnum = wp->w_topline; lnum <= wp->w_buffer->b_ml.ml_line_count; ++lnum)
973 { 973 {
974 // count Tabs for what they are worth 974 int len;
975 int len = win_linetabsize(wp, ml_get_buf(wp->w_buffer, lnum, FALSE), 975 int w_width = wp->w_width;
976
977 // Count Tabs for what they are worth and compute the length based on
978 // the maximum width (matters when 'showbreak' is set).
979 if (wp->w_width < maxwidth)
980 wp->w_width = maxwidth;
981 len = win_linetabsize(wp, ml_get_buf(wp->w_buffer, lnum, FALSE),
976 (colnr_T)MAXCOL); 982 (colnr_T)MAXCOL);
983 wp->w_width = w_width;
977 984
978 if (wp->w_p_wrap) 985 if (wp->w_p_wrap)
979 { 986 {
980 while (len > maxwidth) 987 while (len > maxwidth)
981 { 988 {