Mercurial > vim
comparison src/ex_getln.c @ 16287:a6cffc232b9d v8.1.1148
patch 8.1.1148: CTRL-L with 'incsearch' does not pick up char under cursor
commit https://github.com/vim/vim/commit/730f48fe3691dc62331f3df23cb947bfc33a5add
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Apr 11 13:45:57 2019 +0200
patch 8.1.1148: CTRL-L with 'incsearch' does not pick up char under cursor
Problem: CTRL-L with 'incsearch' does not pick up char under cursor.
(Smylers)
Solution: Do not compare the position with the cursor position. (Hirohito
Higashi, closes #3620)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 11 Apr 2019 14:00:05 +0200 |
parents | cd5c83115ec6 |
children | 5b5c5daf57de |
comparison
equal
deleted
inserted
replaced
16286:a7c48660b263 | 16287:a6cffc232b9d |
---|---|
743 | 743 |
744 // Add a character from under the cursor for 'incsearch'. | 744 // Add a character from under the cursor for 'incsearch'. |
745 if (is_state->did_incsearch) | 745 if (is_state->did_incsearch) |
746 { | 746 { |
747 curwin->w_cursor = is_state->match_end; | 747 curwin->w_cursor = is_state->match_end; |
748 if (!EQUAL_POS(curwin->w_cursor, is_state->search_start)) | 748 *c = gchar_cursor(); |
749 { | 749 if (*c != NUL) |
750 *c = gchar_cursor(); | 750 { |
751 | |
752 // If 'ignorecase' and 'smartcase' are set and the | 751 // If 'ignorecase' and 'smartcase' are set and the |
753 // command line has no uppercase characters, convert | 752 // command line has no uppercase characters, convert |
754 // the character to lowercase. | 753 // the character to lowercase. |
755 if (p_ic && p_scs && !pat_has_uppercase(ccline.cmdbuff + skiplen)) | 754 if (p_ic && p_scs && !pat_has_uppercase(ccline.cmdbuff + skiplen)) |
756 *c = MB_TOLOWER(*c); | 755 *c = MB_TOLOWER(*c); |
757 if (*c != NUL) | 756 if (*c == firstc || vim_strchr((char_u *)( |
758 { | 757 p_magic ? "\\~^$.*[" : "\\^$"), *c) != NULL) |
759 if (*c == firstc || vim_strchr((char_u *)( | 758 { |
760 p_magic ? "\\~^$.*[" : "\\^$"), *c) != NULL) | 759 // put a backslash before special characters |
760 stuffcharReadbuff(*c); | |
761 *c = '\\'; | |
762 } | |
763 // add any composing characters | |
764 if (mb_char2len(*c) != mb_ptr2len(ml_get_cursor())) | |
765 { | |
766 int save_c = *c; | |
767 | |
768 while (mb_char2len(*c) != mb_ptr2len(ml_get_cursor())) | |
761 { | 769 { |
762 // put a backslash before special characters | 770 curwin->w_cursor.col += mb_char2len(*c); |
771 *c = gchar_cursor(); | |
763 stuffcharReadbuff(*c); | 772 stuffcharReadbuff(*c); |
764 *c = '\\'; | |
765 } | 773 } |
766 // add any composing characters | 774 *c = save_c; |
767 if (mb_char2len(*c) != mb_ptr2len(ml_get_cursor())) | 775 } |
768 { | 776 return FAIL; |
769 int save_c = *c; | |
770 | |
771 while (mb_char2len(*c) != mb_ptr2len(ml_get_cursor())) | |
772 { | |
773 curwin->w_cursor.col += mb_char2len(*c); | |
774 *c = gchar_cursor(); | |
775 stuffcharReadbuff(*c); | |
776 } | |
777 *c = save_c; | |
778 } | |
779 return FAIL; | |
780 } | |
781 } | 777 } |
782 } | 778 } |
783 return OK; | 779 return OK; |
784 } | 780 } |
785 #endif | 781 #endif |