comparison src/drawline.c @ 29686:4153e4815b36 v9.0.0183

patch 9.0.0183: extra space after virtual text when 'linebreak' is set Commit: https://github.com/vim/vim/commit/52de3a8d3943520bbd4e5e40a4c43fcc7182dac0 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Aug 10 13:12:03 2022 +0100 patch 9.0.0183: extra space after virtual text when 'linebreak' is set Problem: Extra space after virtual text when 'linebreak' is set. Solution: Do not count virtual text when getting linebreak value. (closes #10884)
author Bram Moolenaar <Bram@vim.org>
date Wed, 10 Aug 2022 14:15:03 +0200
parents addac7a2d951
children 1455814702ad
comparison
equal deleted inserted replaced
29685:e9ec54bdcf34 29686:4153e4815b36
2368 : 0; 2368 : 0;
2369 char_u *p = ptr - (mb_off + 1); 2369 char_u *p = ptr - (mb_off + 1);
2370 chartabsize_T cts; 2370 chartabsize_T cts;
2371 2371
2372 init_chartabsize_arg(&cts, wp, lnum, wlv.vcol, line, p); 2372 init_chartabsize_arg(&cts, wp, lnum, wlv.vcol, line, p);
2373 # ifdef FEAT_PROP_POPUP
2374 // do not want virtual text counted here
2375 cts.cts_has_prop_with_text = FALSE;
2376 # endif
2373 wlv.n_extra = win_lbr_chartabsize(&cts, NULL) - 1; 2377 wlv.n_extra = win_lbr_chartabsize(&cts, NULL) - 1;
2378 clear_chartabsize_arg(&cts);
2374 2379
2375 // We have just drawn the showbreak value, no need to add 2380 // We have just drawn the showbreak value, no need to add
2376 // space for it again. 2381 // space for it again.
2377 if (wlv.vcol == vcol_sbr) 2382 if (wlv.vcol == vcol_sbr)
2378 { 2383 {
2396 - wlv.vcol % (int)wp->w_buffer->b_p_ts - 1; 2401 - wlv.vcol % (int)wp->w_buffer->b_p_ts - 1;
2397 # endif 2402 # endif
2398 2403
2399 wlv.c_extra = mb_off > 0 ? MB_FILLER_CHAR : ' '; 2404 wlv.c_extra = mb_off > 0 ? MB_FILLER_CHAR : ' ';
2400 wlv.c_final = NUL; 2405 wlv.c_final = NUL;
2401 # if defined(FEAT_PROP_POPUP) 2406 # ifdef FEAT_PROP_POPUP
2402 if (wlv.n_extra > 0 && c != TAB) 2407 if (wlv.n_extra > 0 && c != TAB)
2403 in_linebreak = TRUE; 2408 in_linebreak = TRUE;
2404 # endif 2409 # endif
2405 if (VIM_ISWHITE(c)) 2410 if (VIM_ISWHITE(c))
2406 { 2411 {
2410 FIX_FOR_BOGUSCOLS; 2415 FIX_FOR_BOGUSCOLS;
2411 # endif 2416 # endif
2412 if (!wp->w_p_list) 2417 if (!wp->w_p_list)
2413 c = ' '; 2418 c = ' ';
2414 } 2419 }
2415 clear_chartabsize_arg(&cts); 2420 }
2416 } 2421 #endif
2417 #endif
2418
2419 in_multispace = c == ' ' 2422 in_multispace = c == ' '
2420 && ((ptr > line + 1 && ptr[-2] == ' ') || *ptr == ' '); 2423 && ((ptr > line + 1 && ptr[-2] == ' ') || *ptr == ' ');
2421 if (!in_multispace) 2424 if (!in_multispace)
2422 multispace_pos = 0; 2425 multispace_pos = 0;
2423 2426