diff options
Diffstat (limited to 'src/nvim/spell.c')
-rw-r--r-- | src/nvim/spell.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/nvim/spell.c b/src/nvim/spell.c index 1cb679245b..4acbdcc298 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -1398,13 +1398,14 @@ spell_move_to ( capcol = 0; // For checking first word with a capital skip white space. - if (capcol == 0) - capcol = (int)(skipwhite(line) - line); - else if (curline && wp == curwin) { + if (capcol == 0) { + capcol = (int)getwhitecols(line); + } else if (curline && wp == curwin) { // For spellbadword(): check if first word needs a capital. - col = (int)(skipwhite(line) - line); - if (check_need_cap(lnum, col)) + col = (int)getwhitecols(line); + if (check_need_cap(lnum, col)) { capcol = col; + } // Need to get the line again, may have looked at the previous // one. @@ -2976,7 +2977,7 @@ static bool check_need_cap(linenr_T lnum, colnr_T col) line = get_cursor_line_ptr(); endcol = 0; - if ((int)(skipwhite(line) - line) >= (int)col) { + if (getwhitecols(line) >= (int)col) { // At start of line, check if previous line is empty or sentence // ends there. if (lnum == 1) |