Patch 8.0.0364
Problem: ]s does not move cursor with two spell errors in one line. (Manuel
Ortega)
Solution: Don't stop search immediately when wrapped, search the line first.
(Ken Takata) Add a test.
Files: src/spell.c, src/Makefile, src/testdir/test_spell.vim,
src/testdir/Make_all.mak
*** ../vim-8.0.0363/src/spell.c 2016-11-10 20:01:41.201582868 +0100
--- src/spell.c 2017-02-25 14:17:13.361695979 +0100
***************
*** 1734,1747 ****
if (curline)
break; /* only check cursor line */
/* Advance to next line. */
if (dir == BACKWARD)
{
- /* If we are back at the starting line and searched it again there
- * is no match, give up. */
- if (lnum == wp->w_cursor.lnum && wrapped)
- break;
-
if (lnum > 1)
--lnum;
else if (!p_ws)
--- 1734,1747 ----
if (curline)
break; /* only check cursor line */
+ /* If we are back at the starting line and searched it again there
+ * is no match, give up. */
+ if (lnum == wp->w_cursor.lnum && wrapped)
+ break;
+
/* Advance to next line. */
if (dir == BACKWARD)
{
if (lnum > 1)
--lnum;
else if (!p_ws)
***************
*** 1775,1781 ****
/* If we are back at the starting line and there is no match then
* give up. */
! if (lnum == wp->w_cursor.lnum && (!found_one || wrapped))
break;
/* Skip the characters at the start of the next line that were
--- 1775,1781 ----
/* If we are back at the starting line and there is no match then
* give up. */
! if (lnum == wp->w_cursor.lnum && !found_one)
break;
/* Skip the characters at the start of the next line that were
*** ../vim-8.0.0363/src/Makefile 2017-02-23 19:32:18.068709554 +0100
--- src/Makefile 2017-02-25 14:07:44.085061911 +0100
***************
*** 2193,2198 ****
--- 2193,2199 ----
test_smartindent \
test_sort \
test_source_utf8 \
+ test_spell \
test_startup \
test_startup_utf8 \
test_stat \
*** ../vim-8.0.0363/src/testdir/test_spell.vim 2017-02-25 14:20:27.592545219
+0100
--- src/testdir/test_spell.vim 2017-02-25 14:14:25.706688358 +0100
***************
*** 0 ****
--- 1,20 ----
+ " Test spell checking
+ " TODO: move test58 tests here
+
+ if !has('spell')
+ finish
+ endif
+
+ func Test_wrap_search()
+ new
+ call setline(1, ['The', '', 'A plong line with two zpelling mistakes', '',
'End'])
+ set spell wrapscan
+ normal ]s
+ call assert_equal('plong', expand('<cword>'))
+ normal ]s
+ call assert_equal('zpelling', expand('<cword>'))
+ normal ]s
+ call assert_equal('plong', expand('<cword>'))
+ bwipe!
+ set nospell
+ endfunc
*** ../vim-8.0.0363/src/testdir/Make_all.mak 2017-02-23 19:32:18.068709554
+0100
--- src/testdir/Make_all.mak 2017-02-25 14:13:56.186863001 +0100
***************
*** 192,197 ****
--- 192,198 ----
test_search.res \
test_signs.res \
test_smartindent.res \
+ test_spell.res \
test_startup.res \
test_startup_utf8.res \
test_stat.res \
*** ../vim-8.0.0363/src/version.c 2017-02-23 20:20:46.054319107 +0100
--- src/version.c 2017-02-25 14:09:53.796295923 +0100
***************
*** 766,767 ****
--- 766,769 ----
{ /* Add new patch number below this line */
+ /**/
+ 364,
/**/
--
Shift happens.
-- Doppler
/// 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].
For more options, visit https://groups.google.com/d/optout.