1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-02 22:40:06 +08:00

fix(vimchat): fix windows flickr

This commit is contained in:
wsdjeg 2022-05-03 22:19:01 +08:00
parent 992ffadef3
commit 7b85550ac8

View File

@ -379,26 +379,25 @@ function! s:enter() abort
let s:c_begin = ''
return
elseif s:c_begin . s:c_char . s:c_end =~# '/set_protocol\s*'
let saved_protocal = s:protocol
let s:protocol = matchstr(s:c_begin . s:c_char . s:c_end, '/set_protocol\s*\zs\S*')
let protocol = matchstr(s:c_begin . s:c_char . s:c_end, '/set_protocol\s*\zs\S*')
let s:c_end = ''
let s:c_char = ''
let s:c_begin = ''
try
call chat#{s:protocol}#get_channels()
if !has_key(s:opened_channels, s:protocol)
let s:opened_channels[s:protocol] = []
call chat#{protocol}#get_channels()
if !has_key(s:opened_channels, protocol)
let s:opened_channels[protocol] = []
endif
let s:protocol = protocol
catch
call chat#windows#push({
\ 'user' : '--->',
\ 'username' : '--->',
\ 'room' : '',
\ 'protocol' : s:protocol,
\ 'msg' : 'protocal does not exists: ' . s:current_channel,
\ 'msg' : 'protocal does not exists: ' . protocol,
\ 'time': strftime("%Y-%m-%d %H:%M"),
\ })
let s:protocol = saved_protocal
endtry
call s:update_msg_screen()
return