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

fix(vimchat): fix typo in message

This commit is contained in:
wsdjeg 2022-05-04 14:52:58 +08:00
parent 213d088260
commit ec052ec679
3 changed files with 8 additions and 4 deletions

View File

@ -164,7 +164,7 @@ function! s:gitter_fetch_exit(id, data, event) abort
\ 'username' : msg.fromUser.username,
\ 'room' : room,
\ 'msg' : msg.text,
\ 'replays' : get(msg, 'threadMessageCount', 0),
\ 'replyCounts' : get(msg, 'threadMessageCount', 0),
\ 'time': s:format_time(msg.sent),
\ })
endfor

View File

@ -368,8 +368,12 @@ function! s:update_msg_screen() abort
call add(buffer, repeat(' ', 18) . ' ' . nr2char(9474) . ' ' .repeat(' ', 12) . ' ' . nr2char(9474) . ' ' . l )
endfor
endif
if has_key(msg, 'replays') && msg.replays > 0
call add(buffer, repeat(' ', 18) . ' ' . nr2char(9474) . ' ' .repeat(' ', 12) . ' ' . nr2char(9474) . ' ' . printf('-> %s replays', msg.replays))
if has_key(msg, 'replyCounts') && msg.replyCounts > 0
if msg.replyCounts > 1
call add(buffer, repeat(' ', 18) . ' ' . nr2char(9474) . ' ' .repeat(' ', 12) . ' ' . nr2char(9474) . ' ' . printf('-> %s replies', msg.replyCounts))
else
call add(buffer, repeat(' ', 18) . ' ' . nr2char(9474) . ' ' .repeat(' ', 12) . ' ' . nr2char(9474) . ' -> 1 reply')
endif
endif
endfor
call setline(1, buffer)

View File

@ -27,7 +27,7 @@ syntax match VimChatRemoteNick /**`[^`]*`\*\*/ contains=VimChatRemoteNickR,VimCh
syntax match VimChatPing /\s\zs@\S*/
syntax match VimChatQuoteMsg /.*│\s>\s.*/ contains=VimChatTime,VimChatVert,VimChatNick
syn region VimChatCodeBlockLines start=".*│\s*````*.*$" end="│\s*````*\ze\s*$" contains=VimChatTime,VimChatVert,VimChatNick keepend
syntax match VimChatReplayCounts /.*│\s->\s\d*\sreplays/ contains=VimChatTime,VimChatVert,VimChatNick
syntax match VimChatReplayCounts /.*│\s->\s\d*\s\(reply\|replies\)/ contains=VimChatTime,VimChatVert,VimChatNick
" hi def link vimChatMsg Comment
hi def link VimChatTime Comment
hi def link VimChatQuoteMsg Comment