mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-13 02:05:40 +08:00
feat(chat): complete channels regardless of case
This commit is contained in:
parent
c37ac8e848
commit
dd165bd78d
@ -448,9 +448,9 @@ function! SpaceVim#layers#core#statusline#get(...) abort
|
|||||||
return st
|
return st
|
||||||
elseif &filetype ==# 'vimchat'
|
elseif &filetype ==# 'vimchat'
|
||||||
return '%#SpaceVim_statusline_ia#' . s:winnr(1) . '%#SpaceVim_statusline_ia_SpaceVim_statusline_b#' . s:lsep
|
return '%#SpaceVim_statusline_ia#' . s:winnr(1) . '%#SpaceVim_statusline_ia_SpaceVim_statusline_b#' . s:lsep
|
||||||
\ . '%#SpaceVim_statusline_b# Chat %#SpaceVim_statusline_b_SpaceVim_statusline_c#' . s:lsep . ' '
|
\ . '%#SpaceVim_statusline_b# Chat %#SpaceVim_statusline_b_SpaceVim_statusline_c#' . s:lsep
|
||||||
\ . '%#SpaceVim_statusline_c# '
|
\ . '%#SpaceVim_statusline_c# '
|
||||||
\ . '%{chat#windows#status().protocol}' . ' %#SpaceVim_statusline_c_SpaceVim_statusline_b#' . s:lsep . ' '
|
\ . '%{chat#windows#status().protocol}' . ' %#SpaceVim_statusline_c_SpaceVim_statusline_b#' . s:lsep
|
||||||
\ . '%#SpaceVim_statusline_b# '
|
\ . '%#SpaceVim_statusline_b# '
|
||||||
\ . '%{chat#windows#status().channel}' . ' %#SpaceVim_statusline_b_SpaceVim_statusline_c#' . s:lsep
|
\ . '%{chat#windows#status().channel}' . ' %#SpaceVim_statusline_b_SpaceVim_statusline_c#' . s:lsep
|
||||||
elseif &filetype ==# 'git-status'
|
elseif &filetype ==# 'git-status'
|
||||||
|
@ -196,7 +196,9 @@ function! s:get_all_channels_stderr(id, data, event) abort
|
|||||||
endfunction
|
endfunction
|
||||||
function! s:get_all_channels_exit(id, data, event) abort
|
function! s:get_all_channels_exit(id, data, event) abort
|
||||||
call s:LOG.debug(a:data)
|
call s:LOG.debug(a:data)
|
||||||
let s:channels = s:JSON.json_decode(join(s:list_all_channels_result, ''))
|
if a:data ==# 0
|
||||||
|
let s:channels = s:JSON.json_decode(join(s:list_all_channels_result, ''))
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! Test(str) abort
|
function! Test(str) abort
|
||||||
|
@ -362,7 +362,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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user