diff options
author | Bram Moolenaar <Bram@vim.org> | 2008-04-01 15:14:36 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2008-04-01 15:14:36 +0000 |
commit | 6a5d2ac1d0e154e717dfb7e66792dfb464925372 (patch) | |
tree | a96baaa334a6820956745d818fb8f3e856a3a000 /src/spell.c | |
parent | 2a3297464619cbf7c2842534e3e8d252b9c59069 (diff) | |
download | vim-git-6a5d2ac1d0e154e717dfb7e66792dfb464925372.tar.gz |
updated for version 7.1-290v7.1.290
Diffstat (limited to 'src/spell.c')
-rw-r--r-- | src/spell.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/spell.c b/src/spell.c index f45be18c2..567c6cd36 100644 --- a/src/spell.c +++ b/src/spell.c @@ -2268,6 +2268,8 @@ spell_move_to(wp, dir, allwords, curline, attrp) /* * For spell checking: concatenate the start of the following line "line" into * "buf", blanking-out special characters. Copy less then "maxlen" bytes. + * Keep the blanks at the start of the next line, this is used in win_line() + * to skip those bytes if the word was OK. */ void spell_cat_line(buf, line, maxlen) @@ -2284,12 +2286,14 @@ spell_cat_line(buf, line, maxlen) if (*p != NUL) { - *buf = ' '; - vim_strncpy(buf + 1, line, maxlen - 2); - n = (int)(p - line); - if (n >= maxlen) - n = maxlen - 1; - vim_memset(buf + 1, ' ', n); + /* Only worth concatenating if there is something else than spaces to + * concatenate. */ + n = (int)(p - line) + 1; + if (n < maxlen - 1) + { + vim_memset(buf, ' ', n); + vim_strncpy(buf + n, p, maxlen - 1 - n); + } } } |