mirror of
https://github.com/neovim/neovim.git
synced 2025-10-07 10:26:31 +00:00
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)
f578ca2c8f
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -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) {
|
||||
|
@@ -540,7 +540,7 @@ void grid_put_linebuf(ScreenGrid *grid, int row, int coloff, int endcol, int cle
|
||||
size_t skip = 0;
|
||||
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 < max_off_from && ascii_isdigit(*linebuf_char[off])) {
|
||||
off++;
|
||||
skip++;
|
||||
|
Reference in New Issue
Block a user