diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-06-11 11:29:39 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-11 11:29:39 +0800 |
commit | 2237b384e4027af7c977a4be01d792fcb790819c (patch) | |
tree | a7bbd4a8e4909d2eb5338173d65230810b3c51f0 /src/nvim/drawline.c | |
parent | 302d3cfb96d7f0c856262e1a4252d058e3300c8b (diff) | |
download | rneovim-2237b384e4027af7c977a4be01d792fcb790819c.tar.gz rneovim-2237b384e4027af7c977a4be01d792fcb790819c.tar.bz2 rneovim-2237b384e4027af7c977a4be01d792fcb790819c.zip |
vim-patch:9.0.1626: Visual area not shown when using 'showbreak' (#23978)
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 vim/vim#12514)
https://github.com/vim/vim/commit/f578ca2c8f36b61ac3301fe8b59a8473c964cdc2
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/drawline.c')
-rw-r--r-- | src/nvim/drawline.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c index ff14ae0e41..280c1d6994 100644 --- a/src/nvim/drawline.c +++ b/src/nvim/drawline.c @@ -92,7 +92,7 @@ typedef struct { int fromcol; ///< start of inverting int tocol; ///< end of inverting - long vcol_sbr; ///< virtual column after showbreak + colnr_T vcol_sbr; ///< virtual column after showbreak bool need_showbreak; ///< overlong line, skipping first x chars int char_attr; ///< attributes for next character @@ -832,6 +832,12 @@ static void handle_showbreak_and_filler(win_T *wp, winlinevars_T *wlv) 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) { |