Patch 8.1.2172
Problem:    Spell highlight is wrong at start of the line.
Solution:   Fix setting the "v" variable. (closes #5078)
Files:      src/drawline.c, src/testdir/test_spell.vim,
            src/testdir/dumps/Test_spell_1.dump



*** ../vim-8.1.2171/src/drawline.c      2019-10-16 21:33:37.523551169 +0200
--- src/drawline.c      2019-10-18 20:30:40.362590623 +0200
***************
*** 1824,1829 ****
--- 1824,1830 ----
                // 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,1880 ****
                            // 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);
                        }
  
                        // Turn index into actual attributes.
--- 1875,1882 ----
                            // 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);
                        }
  
                        // Turn index into actual attributes.
*** ../vim-8.1.2171/src/testdir/test_spell.vim  2019-10-10 14:08:23.433080875 
+0200
--- src/testdir/test_spell.vim  2019-10-18 20:34:33.725505525 +0200
***************
*** 4,9 ****
--- 4,11 ----
  source check.vim
  CheckFeature spell
  
+ source screendump.vim
+ 
  func TearDown()
    set nospell
    call delete('Xtest.aff')
***************
*** 460,465 ****
--- 462,490 ----
    bwipe!
  endfunc
  
+ func Test_spell_screendump()
+   CheckScreendump
+ 
+   let lines =<< trim END
+        call setline(1, [
+              \ "This is some text without any spell errors.  Everything",
+              \ "should just be black, nothing wrong here.",
+              \ "",
+              \ "This line has a sepll error. and missing caps.",
+              \ "And and this is the the duplication.",
+              \ "with missing caps here.",
+              \ ])
+        set spell spelllang=en_nz
+   END
+   call writefile(lines, 'XtestSpell')
+   let buf = RunVimInTerminal('-S XtestSpell', {'rows': 8})
+   call VerifyScreenDump(buf, 'Test_spell_1', {})
+ 
+   " clean up
+   call StopVimInTerminal(buf)
+   call delete('XtestSpell')
+ endfunc
+ 
  let g:test_data_aff1 = [
        \"SET ISO8859-1",
        \"TRY 
esianrtolcdugmphbyfvkwjkqxz-\xEB\xE9\xE8\xEA\xEF\xEE\xE4\xE0\xE2\xF6\xFC\xFB'ESIANRTOLCDUGMPHBYFVKWJKQXZ",
*** ../vim-8.1.2171/src/testdir/dumps/Test_spell_1.dump 2019-10-18 
20:36:36.353195317 +0200
--- src/testdir/dumps/Test_spell_1.dump 2019-10-18 20:34:41.425481584 +0200
***************
*** 0 ****
--- 1,8 ----
+ >T+0&#ffffff0|h|i|s| |i|s| |s|o|m|e| |t|e|x|t| |w|i|t|h|o|u|t| |a|n|y| 
|s|p|e|l@1| |e|r@1|o|r|s|.| @1|E|v|e|r|y|t|h|i|n|g| @19
+ |s|h|o|u|l|d| |j|u|s|t| |b|e| |b|l|a|c|k|,| |n|o|t|h|i|n|g| |w|r|o|n|g| 
|h|e|r|e|.| @33
+ @75
+ |T|h|i|s| |l|i|n|e| |h|a|s| |a| |s+0&#ffd7d7255|e|p|l@1| 
+0&#ffffff0|e|r@1|o|r|.| |a+0&#5fd7ff255|n|d| +0&#ffffff0|m|i|s@1|i|n|g| 
|c|a|p|s|.| @28
+ |A+0&#ffd7d7255|n|d| |a|n|d| +0&#ffffff0|t|h|i|s| |i|s| |t+0&#ffd7d7255|h|e| 
|t|h|e| +0&#ffffff0|d|u|p|l|i|c|a|t|i|o|n|.| @38
+ |w+0&#5fd7ff255|i|t|h| +0&#ffffff0|m|i|s@1|i|n|g| |c|a|p|s| |h|e|r|e|.| @51
+ |~+0#4040ff13&| @73
+ | +0#0000000&@56|1|,|1| @10|A|l@1| 
*** ../vim-8.1.2171/src/version.c       2019-10-17 22:59:53.482325534 +0200
--- src/version.c       2019-10-18 20:25:32.297574628 +0200
***************
*** 743,744 ****
--- 743,746 ----
  {   /* Add new patch number below this line */
+ /**/
+     2172,
  /**/

-- 
Wi n0t trei a h0liday in Sweden thi yer?
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201910181840.x9IIe5tC016720%40masaka.moolenaar.net.

Raspunde prin e-mail lui