1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 14:00:05 +08:00

feat(chat): complete channel with ignorecase

This commit is contained in:
wsdjeg 2022-05-01 13:24:11 +08:00
parent 1551d4f750
commit bb9d83beb4

View File

@ -314,7 +314,7 @@ function! s:complete(base,num) abort
return rsl[a:num % len(rsl)] return rsl[a:num % len(rsl)]
endif endif
elseif a:base =~# '^/set_protocol\s*\w*$' elseif a:base =~# '^/set_protocol\s*\w*$'
let rsl = filter(copy(s:all_protocols), "v:val =~# matchstr(a:base, '\w*$') .'[^\ .]*'") let rsl = filter(copy(s:all_protocols), "v:val =~# matchstr(a:base, '\\w*$') .'[^\ .]*'")
if len(rsl) > 0 if len(rsl) > 0
return matchstr(a:base, '^/set_protocol\s*') . rsl[a:num % len(rsl)] return matchstr(a:base, '^/set_protocol\s*') . rsl[a:num % len(rsl)]
endif endif
@ -324,7 +324,7 @@ function! s:complete(base,num) abort
let channels = chat#{s:protocol}#get_channels() let channels = chat#{s:protocol}#get_channels()
catch catch
endtry endtry
let rsl = filter(copy(channels), "v:val =~# '^' . matchstr(a:base, '\\w*$')") let rsl = filter(copy(channels), "v:val =~ '^' . matchstr(a:base, '\\w*$')")
if len(rsl) > 0 if len(rsl) > 0
return matchstr(a:base, '^/set_channel\s*') . rsl[a:num % len(rsl)] return matchstr(a:base, '^/set_channel\s*') . rsl[a:num % len(rsl)]
endif endif