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/charset.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/charset.c')
-rw-r--r-- | src/nvim/charset.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/nvim/charset.c b/src/nvim/charset.c index f1b3be6b46..4e8bb3b0d7 100644 --- a/src/nvim/charset.c +++ b/src/nvim/charset.c @@ -30,7 +30,7 @@ #include "nvim/state.h" #include "nvim/strings.h" #include "nvim/path.h" - +#include "nvim/cursor.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "charset.c.generated.h" @@ -1465,6 +1465,18 @@ char_u *skipwhite(const char_u *q) return (char_u *)p; } +// getwhitecols: return the number of whitespace +// columns (bytes) at the start of a given line +intptr_t getwhitecols_curline(void) +{ + return getwhitecols(get_cursor_line_ptr()); +} + +intptr_t getwhitecols(const char_u *p) +{ + return skipwhite(p) - p; +} + /// Skip over digits /// /// @param[in] q String to skip digits in. |