diff src/drawline.c @ 32588:25f4c1d11344 v9.0.1626

patch 9.0.1626: Visual area not shown when using 'showbreak' Commit: https://github.com/vim/vim/commit/f578ca2c8f36b61ac3301fe8b59a8473c964cdc2 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jun 10 19:40:30 2023 +0100 patch 9.0.1626: Visual area not shown when using 'showbreak' Problem: Visual area not shown when using 'showbreak' and start of line is not visible. (Jaehwang Jung) Solution: Adjust "fromcol" for the space taken by 'showbreak'. (closes #12514)
author Bram Moolenaar <Bram@vim.org>
date Sat, 10 Jun 2023 20:45:06 +0200
parents cceee401aa51
children 448aef880252
line wrap: on
line diff
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -569,6 +569,11 @@ handle_showbreak_and_filler(win_T *wp, w
 	if (wp->w_skipcol == 0 || wlv->startrow != 0 || !wp->w_p_wrap)
 	    wlv->need_showbreak = FALSE;
 	wlv->vcol_sbr = wlv->vcol + MB_CHARLEN(sbr);
+
+	// Correct start of highlighted area for 'showbreak'.
+	if (wlv->fromcol >= wlv->vcol && wlv->fromcol < wlv->vcol_sbr)
+	    wlv->fromcol = wlv->vcol_sbr;
+
 	// Correct end of highlighted area for 'showbreak',
 	// required when 'linebreak' is also set.
 	if (wlv->tocol == wlv->vcol)
@@ -829,7 +834,7 @@ wlv_screen_line(win_T *wp, winlinevars_T
 
 	if (wp->w_p_nu && wp->w_p_rnu)
 	    // Do not overwrite the line number, change "123 text" to
-	    // "123>>>xt".
+	    // "123<<<xt".
 	    while (skip < wp->w_width && VIM_ISDIGIT(ScreenLines[off]))
 	    {
 		++off;