diff options
author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-08-23 04:43:44 -0400 |
---|---|---|
committer | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-08-23 10:00:53 -0400 |
commit | d677ae5f6461dcd78f08caec2c4fa72e6e275137 (patch) | |
tree | 939b783497deef4f314f008f7c593285672f02a9 /src/nvim/edit.c | |
parent | fe57a8a4e410e19f05a4137709632ee375b1c2aa (diff) | |
download | rneovim-d677ae5f6461dcd78f08caec2c4fa72e6e275137.tar.gz rneovim-d677ae5f6461dcd78f08caec2c4fa72e6e275137.tar.bz2 rneovim-d677ae5f6461dcd78f08caec2c4fa72e6e275137.zip |
vim-patch:8.0.1041: bogus characters when indenting during visual-block append
Problem: Bogus characters appear when indenting kicks in while doing a
visual-block append.
Solution: Recompute when indenting is done. (Christian Brabandt)
https://github.com/vim/vim/commit/e2e69e48134cbfdedea7802810932f8592705024
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r-- | src/nvim/edit.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 085f12473e..be2797ee3e 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -4506,7 +4506,7 @@ static int ins_complete(int c, bool enable_pum) * first non_blank in the line, if it is not a wordchar * include it to get a better pattern, but then we don't * want the "\\<" prefix, check it bellow */ - compl_col = (colnr_T)(skipwhite(line) - line); + compl_col = (colnr_T)getwhitecols(line); compl_startpos.col = compl_col; compl_startpos.lnum = curwin->w_cursor.lnum; compl_cont_status &= ~CONT_SOL; /* clear SOL if present */ @@ -4625,7 +4625,7 @@ static int ins_complete(int c, bool enable_pum) } } } else if (CTRL_X_MODE_LINE_OR_EVAL(ctrl_x_mode)) { - compl_col = (colnr_T)(skipwhite(line) - line); + compl_col = (colnr_T)getwhitecols(line); compl_length = (int)curs_col - (int)compl_col; if (compl_length < 0) /* cursor in indent: empty pattern */ compl_length = 0; @@ -6963,8 +6963,7 @@ bool in_cinkeys(int keytyped, int when, bool line_is_empty) if (match && try_match_word && !try_match) { /* "0=word": Check if there are only blanks before the * word. */ - line = get_cursor_line_ptr(); - if ((int)(skipwhite(line) - line) != + if (getwhitecols(line) != (int)(curwin->w_cursor.col - (p - look))) match = FALSE; } |