Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
32587:2ab810fbff1f | 32588:25f4c1d11344 |
---|---|
567 wlv->c_final = NUL; | 567 wlv->c_final = NUL; |
568 wlv->n_extra = (int)STRLEN(sbr); | 568 wlv->n_extra = (int)STRLEN(sbr); |
569 if (wp->w_skipcol == 0 || wlv->startrow != 0 || !wp->w_p_wrap) | 569 if (wp->w_skipcol == 0 || wlv->startrow != 0 || !wp->w_p_wrap) |
570 wlv->need_showbreak = FALSE; | 570 wlv->need_showbreak = FALSE; |
571 wlv->vcol_sbr = wlv->vcol + MB_CHARLEN(sbr); | 571 wlv->vcol_sbr = wlv->vcol + MB_CHARLEN(sbr); |
572 | |
573 // Correct start of highlighted area for 'showbreak'. | |
574 if (wlv->fromcol >= wlv->vcol && wlv->fromcol < wlv->vcol_sbr) | |
575 wlv->fromcol = wlv->vcol_sbr; | |
576 | |
572 // Correct end of highlighted area for 'showbreak', | 577 // Correct end of highlighted area for 'showbreak', |
573 // required when 'linebreak' is also set. | 578 // required when 'linebreak' is also set. |
574 if (wlv->tocol == wlv->vcol) | 579 if (wlv->tocol == wlv->vcol) |
575 wlv->tocol += wlv->n_extra; | 580 wlv->tocol += wlv->n_extra; |
576 // combine 'showbreak' with 'wincolor' | 581 // combine 'showbreak' with 'wincolor' |
827 int max_off = off + screen_Columns; | 832 int max_off = off + screen_Columns; |
828 int skip = 0; | 833 int skip = 0; |
829 | 834 |
830 if (wp->w_p_nu && wp->w_p_rnu) | 835 if (wp->w_p_nu && wp->w_p_rnu) |
831 // Do not overwrite the line number, change "123 text" to | 836 // Do not overwrite the line number, change "123 text" to |
832 // "123>>>xt". | 837 // "123<<<xt". |
833 while (skip < wp->w_width && VIM_ISDIGIT(ScreenLines[off])) | 838 while (skip < wp->w_width && VIM_ISDIGIT(ScreenLines[off])) |
834 { | 839 { |
835 ++off; | 840 ++off; |
836 ++skip; | 841 ++skip; |
837 } | 842 } |