Mirror of the Vim source from https://github.com/vim/vim
Révision | 00548e40e708e65f46565a92b50655927b5a8785 (tree) |
---|---|
l'heure | 2020-11-25 22:00:04 |
Auteur | Bram Moolenaar <Bram@vim....> |
Commiter | Bram Moolenaar |
patch 8.2.2045: highlighting a character too much with incsearch
Commit: https://github.com/vim/vim/commit/448465e6872905967c97a56cd45307530795653c
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Nov 25 13:49:27 2020 +0100
@@ -641,7 +641,7 @@ | ||
641 | 641 | else |
642 | 642 | tocol = MAXCOL; |
643 | 643 | // do at least one character; happens when past end of line |
644 | - if (fromcol == tocol) | |
644 | + if (fromcol == tocol && search_match_endcol) | |
645 | 645 | tocol = fromcol + 1; |
646 | 646 | area_highlighting = TRUE; |
647 | 647 | vi_attr = HL_ATTR(HLF_I); |
@@ -0,0 +1,5 @@ | ||
1 | +|t+1&#ffffff0|e|s|t| +0&&@5 | |
2 | +|x@2| @6 | |
3 | +|~+0#4040ff13&| @8 | |
4 | +|~| @8 | |
5 | +|/+0#0000000&|t|e|s|t> @4 |
@@ -0,0 +1,5 @@ | ||
1 | +|t+1&#ffffff0|e|s|t| | +0&&@4 | |
2 | +|x@2| @6 | |
3 | +|~+0#4040ff13&| @8 | |
4 | +|~| @8 | |
5 | +|/+0#0000000&|t|e|s|t|\|n> @2 |
@@ -0,0 +1,5 @@ | ||
1 | +|t+1&#ffffff0|e|s|t| | +0&&@4 | |
2 | +|x+1&&|x+0&&@1| @6 | |
3 | +|~+0#4040ff13&| @8 | |
4 | +|~| @8 | |
5 | +|/+0#0000000&|t|e|s|t|\|n|x> @1 |
@@ -0,0 +1,5 @@ | ||
1 | +|t+1&#ffffff0|e|s|t| | +0&&@4 | |
2 | +|x+1&&@1|x+0&&| @6 | |
3 | +|~+0#4040ff13&| @8 | |
4 | +|~| @8 | |
5 | +|/+0#0000000&|t|e|s|t|\|n|x@1> |
@@ -0,0 +1,5 @@ | ||
1 | +|o+0#00e0003#ffffff0|r| |t|y|p|e| |c|o | |
2 | +|m| @7|m | |
3 | +|a|n|d| |t|o| |c|o|n | |
4 | +|t| @7|i | |
5 | +|n|u|e> +0#0000000&@6 |
@@ -1776,4 +1776,40 @@ | ||
1776 | 1776 | close! |
1777 | 1777 | endfunc |
1778 | 1778 | |
1779 | +func Test_zzzz_incsearch_highlighting_newline() | |
1780 | + CheckRunVimInTerminal | |
1781 | + CheckOption incsearch | |
1782 | + CheckScreendump | |
1783 | + new | |
1784 | + call test_override("char_avail", 1) | |
1785 | + | |
1786 | + let commands =<< trim [CODE] | |
1787 | + set incsearch nohls | |
1788 | + call setline(1, ['test', 'xxx']) | |
1789 | + [CODE] | |
1790 | + call writefile(commands, 'Xincsearch_nl') | |
1791 | + let buf = RunVimInTerminal('-S Xincsearch_nl', {'rows': 5, 'cols': 10}) | |
1792 | + " Need to send one key at a time to force a redraw | |
1793 | + call term_sendkeys(buf, '/test') | |
1794 | + sleep 100m | |
1795 | + call VerifyScreenDump(buf, 'Test_incsearch_newline1', {}) | |
1796 | + call term_sendkeys(buf, '\n') | |
1797 | + sleep 100m | |
1798 | + call VerifyScreenDump(buf, 'Test_incsearch_newline2', {}) | |
1799 | + call term_sendkeys(buf, 'x') | |
1800 | + sleep 100m | |
1801 | + call VerifyScreenDump(buf, 'Test_incsearch_newline3', {}) | |
1802 | + call term_sendkeys(buf, 'x') | |
1803 | + call VerifyScreenDump(buf, 'Test_incsearch_newline4', {}) | |
1804 | + call term_sendkeys(buf, "\<CR>") | |
1805 | + sleep 100m | |
1806 | + call VerifyScreenDump(buf, 'Test_incsearch_newline5', {}) | |
1807 | + call StopVimInTerminal(buf) | |
1808 | + | |
1809 | + " clean up | |
1810 | + call delete('Xincsearch_nl') | |
1811 | + call test_override("char_avail", 0) | |
1812 | + bw | |
1813 | +endfunc | |
1814 | + | |
1779 | 1815 | " vim: shiftwidth=2 sts=2 expandtab |
@@ -751,6 +751,8 @@ | ||
751 | 751 | static int included_patches[] = |
752 | 752 | { /* Add new patch number below this line */ |
753 | 753 | /**/ |
754 | + 2045, | |
755 | +/**/ | |
754 | 756 | 2044, |
755 | 757 | /**/ |
756 | 758 | 2043, |