diff --git a/bundle/vim-chat/autoload/chat/windows.vim b/bundle/vim-chat/autoload/chat/windows.vim index 7db4be851..e16e042ef 100644 --- a/bundle/vim-chat/autoload/chat/windows.vim +++ b/bundle/vim-chat/autoload/chat/windows.vim @@ -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