Mercurial > vim
comparison src/spell.c @ 10950:2297aae8e127 v8.0.0364
patch 8.0.0364: ]s does not move cursor with two spell errors in one line
commit https://github.com/vim/vim/commit/d3f78dc9ebd729475a7f24a50a91112e300d5ac9
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Feb 25 14:21:10 2017 +0100
patch 8.0.0364: ]s does not move cursor with two spell errors in one line
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.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 25 Feb 2017 14:30:04 +0100 |
parents | 66f1b5bf3fa6 |
children | 778c10516955 |
comparison
equal
deleted
inserted
replaced
10949:305dd0c5f52f | 10950:2297aae8e127 |
---|---|
1732 } | 1732 } |
1733 | 1733 |
1734 if (curline) | 1734 if (curline) |
1735 break; /* only check cursor line */ | 1735 break; /* only check cursor line */ |
1736 | 1736 |
1737 /* If we are back at the starting line and searched it again there | |
1738 * is no match, give up. */ | |
1739 if (lnum == wp->w_cursor.lnum && wrapped) | |
1740 break; | |
1741 | |
1737 /* Advance to next line. */ | 1742 /* Advance to next line. */ |
1738 if (dir == BACKWARD) | 1743 if (dir == BACKWARD) |
1739 { | 1744 { |
1740 /* If we are back at the starting line and searched it again there | |
1741 * is no match, give up. */ | |
1742 if (lnum == wp->w_cursor.lnum && wrapped) | |
1743 break; | |
1744 | |
1745 if (lnum > 1) | 1745 if (lnum > 1) |
1746 --lnum; | 1746 --lnum; |
1747 else if (!p_ws) | 1747 else if (!p_ws) |
1748 break; /* at first line and 'nowrapscan' */ | 1748 break; /* at first line and 'nowrapscan' */ |
1749 else | 1749 else |
1773 give_warning((char_u *)_(bot_top_msg), TRUE); | 1773 give_warning((char_u *)_(bot_top_msg), TRUE); |
1774 } | 1774 } |
1775 | 1775 |
1776 /* If we are back at the starting line and there is no match then | 1776 /* If we are back at the starting line and there is no match then |
1777 * give up. */ | 1777 * give up. */ |
1778 if (lnum == wp->w_cursor.lnum && (!found_one || wrapped)) | 1778 if (lnum == wp->w_cursor.lnum && !found_one) |
1779 break; | 1779 break; |
1780 | 1780 |
1781 /* Skip the characters at the start of the next line that were | 1781 /* Skip the characters at the start of the next line that were |
1782 * included in a match crossing line boundaries. */ | 1782 * included in a match crossing line boundaries. */ |
1783 if (attr == HLF_COUNT) | 1783 if (attr == HLF_COUNT) |