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

fix(chat): fix next/previous channel

This commit is contained in:
wsdjeg 2022-04-30 19:12:07 +08:00
parent 2fc1389cce
commit 3bff3f833d

View File

@ -334,7 +334,7 @@ function! s:previous_channel() abort
if !empty(s:protocol) && has_key(s:opened_channels, s:protocol) && index(s:opened_channels[s:protocol], s:current_channel) !=# -1 if !empty(s:protocol) && has_key(s:opened_channels, s:protocol) && index(s:opened_channels[s:protocol], s:current_channel) !=# -1
let index = index(s:opened_channels[s:protocol], s:current_channel) let index = index(s:opened_channels[s:protocol], s:current_channel)
let index -=1 let index -=1
let s:current_channel = s:current_channel[s:protocol][index] let s:current_channel = s:opened_channels[s:protocol][index]
call chat#{s:protocol}#enter_room(s:current_channel) call chat#{s:protocol}#enter_room(s:current_channel)
call s:update_msg_screen() call s:update_msg_screen()
call s:update_statusline() call s:update_statusline()
@ -348,7 +348,7 @@ function! s:next_channel() abort
if index ==# len(s:opened_channels[s:protocol]) if index ==# len(s:opened_channels[s:protocol])
let index = 0 let index = 0
endif endif
let s:current_channel = s:current_channel[s:protocol][index] let s:current_channel = s:opened_channels[s:protocol][index]
call chat#{s:protocol}#enter_room(s:current_channel) call chat#{s:protocol}#enter_room(s:current_channel)
call s:update_msg_screen() call s:update_msg_screen()
call s:update_statusline() call s:update_statusline()