patch 8.1.2172: spell highlight is wrong at start of the line
Problem: Spell highlight is wrong at start of the line.
Solution: Fix setting the "v" variable. (closes #5078)
diff --git a/src/drawline.c b/src/drawline.c
index 9a4ff7d..333eeba 100644
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -1824,6 +1824,7 @@
// Only do this when there is no syntax highlighting, the
// @Spell cluster is not used or the current syntax item
// contains the @Spell cluster.
+ v = (long)(ptr - line);
if (has_spell && v >= word_end && v > cur_checked_col)
{
spell_attr = 0;
@@ -1874,7 +1875,8 @@
// Remember that the good word continues at the
// start of the next line.
checked_lnum = lnum + 1;
- checked_col = (int)((p - nextline) + len - nextline_idx);
+ checked_col = (int)((p - nextline)
+ + len - nextline_idx);
}
// Turn index into actual attributes.