1
0
forked from aniani/vim

patch 9.1.0654: completion does not respect completeslash with fuzzy

Problem:  completion does not respect completeslash with fuzzy
          (egesip)
Solution: Change path separator on Windows, depending on 'completeslash'
          option value (glepnir)

fixes: #15392
closes: #15418

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
glepnir
2024-08-02 19:14:38 +02:00
committed by Christian Brabandt
parent a0b5bc1285
commit b9de1a057f
3 changed files with 60 additions and 1 deletions

View File

@@ -2668,6 +2668,38 @@ func Test_complete_fuzzy_match()
unlet g:word
endfunc
func Test_complete_fuzzy_with_completeslash()
CheckMSWindows
call writefile([''], 'fobar', 'D')
let orig_shellslash = &shellslash
set cpt&
new
set completeopt+=fuzzy
set noshellslash
" Test with completeslash unset
set completeslash=
call setline(1, ['.\fob'])
call feedkeys("A\<C-X>\<C-F>\<Esc>0", 'tx!')
call assert_equal('.\fobar', getline('.'))
" Test with completeslash=backslash
set completeslash=backslash
call feedkeys("S.\\fob\<C-X>\<C-F>\<Esc>0", 'tx!')
call assert_equal('.\fobar', getline('.'))
" Test with completeslash=slash
set completeslash=slash
call feedkeys("S.\\fob\<C-X>\<C-F>\<Esc>0", 'tx!')
call assert_equal('./fobar', getline('.'))
" Reset and clean up
let &shellslash = orig_shellslash
set completeslash=
%bw!
endfunc
" Check that tie breaking is stable for completeopt+=fuzzy (which should
" behave the same on different platforms).
func Test_complete_fuzzy_match_tie()