mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
patch 9.2.0583: completion: indent not ignored for fuzzy line completion
Problem: Indent is not stripped in whole-line completion (CTRL-X
CTRL-L).
Solution: Skip the matched line's indent for whole-line matches in
search_for_fuzzy_match (glepnir).
closes: #20405
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
e2d1c334ee
commit
9fa5f64135
+6
-2
@@ -865,11 +865,15 @@ search_for_fuzzy_match(
|
||||
}
|
||||
else
|
||||
{
|
||||
if (fuzzy_match_str(*ptr, pattern) != FUZZY_SCORE_NONE)
|
||||
char_u *line = *ptr;
|
||||
char_u *p = skipwhite(line);
|
||||
if (fuzzy_match_str(p, pattern) != FUZZY_SCORE_NONE)
|
||||
{
|
||||
found_new_match = TRUE;
|
||||
*pos = current_pos;
|
||||
*len = (int)ml_get_buf_len(buf, current_pos.lnum);
|
||||
*ptr = p;
|
||||
*len = (int)ml_get_buf_len(buf, current_pos.lnum) -
|
||||
(int)(p - line);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3696,10 +3696,16 @@ func Test_complete_opt_fuzzy()
|
||||
call feedkeys("Goa\<C-P>\<C-Y>\<Esc>", 'tx')
|
||||
call assert_equal('aaaa', getline('.'))
|
||||
|
||||
%d
|
||||
set autoindent
|
||||
set completeopt=menuone,fuzzy
|
||||
call feedkeys("A\<TAB>hello world\<CR>word is on fire\<CR>w\<C-X>\<C-L>\<C-Y>", 'tx')
|
||||
call assert_equal("\thello world", getline('.'))
|
||||
|
||||
" clean up
|
||||
set omnifunc=
|
||||
bw!
|
||||
set complete& completeopt&
|
||||
set complete& completeopt& autoindent&
|
||||
autocmd! AAAAA_Group
|
||||
augroup! AAAAA_Group
|
||||
delfunc OnPumChange
|
||||
|
||||
@@ -729,6 +729,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
583,
|
||||
/**/
|
||||
582,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user