1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-03-23 17:49:57 +08:00

fix(indent): fix indent

This commit is contained in:
wsdjeg 2022-04-30 19:02:32 +08:00
parent 59770a07b8
commit 2fc1389cce

View File

@ -184,7 +184,7 @@ function! s:echon() abort
echohl None | echon s:c_end echohl None | echon s:c_end
endfunction endfunction
fu! s:windowsinit() abort function! s:windowsinit() abort
" option " option
setl fileformat=unix setl fileformat=unix
setl fileencoding=utf-8 setl fileencoding=utf-8
@ -205,10 +205,10 @@ fu! s:windowsinit() abort
setl nofoldenable setl nofoldenable
setl cursorline setl cursorline
setl filetype=vimchat setl filetype=vimchat
endf endfunction
let s:enter_history = [] let s:enter_history = []
function! s:enter() abort function! s:enter() abort
if s:c_begin . s:c_char . s:c_end =~# '/quit\s*' if s:c_begin . s:c_char . s:c_end =~# '/quit\s*'
let s:quit_chating_win = 1 let s:quit_chating_win = 1
let s:c_end = '' let s:c_end = ''
@ -250,10 +250,10 @@ fu! s:windowsinit() abort
let s:c_end = '' let s:c_end = ''
let s:c_char = '' let s:c_char = ''
let s:c_begin = '' let s:c_begin = ''
endfunction endfunction
let s:complete_num = 0 let s:complete_num = 0
function! s:complete(base,num) abort function! s:complete(base,num) abort
if a:base =~# '^/[a-z_A-Z]*$' if a:base =~# '^/[a-z_A-Z]*$'
let rsl = filter(copy(s:chatting_commands), "v:val =~# a:base .'[^\ .]*'") let rsl = filter(copy(s:chatting_commands), "v:val =~# a:base .'[^\ .]*'")
if len(rsl) > 0 if len(rsl) > 0
@ -278,9 +278,9 @@ fu! s:windowsinit() abort
return a:base return a:base
endfunction endfunction
let s:complete_input_history_num = [0,0] let s:complete_input_history_num = [0,0]
function! s:complete_input_history(base,num) abort function! s:complete_input_history(base,num) abort
let results = filter(copy(s:enter_history), "v:val =~# '^' . a:base") let results = filter(copy(s:enter_history), "v:val =~# '^' . a:base")
if len(results) > 0 if len(results) > 0
call add(results, a:base) call add(results, a:base)
@ -289,9 +289,9 @@ fu! s:windowsinit() abort
else else
return a:base return a:base
endif endif
endfunction endfunction
function! s:init_hi() abort function! s:init_hi() abort
if get(s:, 'init_hi_done', 0) == 0 if get(s:, 'init_hi_done', 0) == 0
" current channel " current channel
hi! ChattingHI1 ctermbg=003 ctermfg=Black guibg=#fabd2f guifg=#282828 hi! ChattingHI1 ctermbg=003 ctermfg=Black guibg=#fabd2f guifg=#282828
@ -325,12 +325,12 @@ fu! s:windowsinit() abort
hi! ChattingHI15 guibg=#fabd2f guifg=#8ec07c hi! ChattingHI15 guibg=#fabd2f guifg=#8ec07c
let s:init_hi_done = 1 let s:init_hi_done = 1
endif endif
endfunction endfunction
function! s:update_statusline() abort function! s:update_statusline() abort
let &l:statusline = SpaceVim#layers#core#statusline#get(1) let &l:statusline = SpaceVim#layers#core#statusline#get(1)
endfunction endfunction
function! s:previous_channel() abort 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
@ -339,9 +339,9 @@ fu! s:windowsinit() abort
call s:update_msg_screen() call s:update_msg_screen()
call s:update_statusline() call s:update_statusline()
endif endif
endfunction endfunction
function! s:next_channel() abort function! s:next_channel() abort
if !empty(s:protocol) && has_key(s:opened_channels, s:protocol) if !empty(s:protocol) && has_key(s:opened_channels, s:protocol)
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
@ -353,19 +353,19 @@ fu! s:windowsinit() abort
call s:update_msg_screen() call s:update_msg_screen()
call s:update_statusline() call s:update_statusline()
endif endif
endfunction endfunction
function! s:send(msg) abort function! s:send(msg) abort
if !empty(s:protocol) && !empty(s:current_channel) if !empty(s:protocol) && !empty(s:current_channel)
call chat#{s:protocol}#send(s:current_channel, a:msg) call chat#{s:protocol}#send(s:current_channel, a:msg)
endif endif
endfunction endfunction
function! chat#windows#status() abort function! chat#windows#status() abort
return { return {
\ 'channel' : s:current_channel, \ 'channel' : s:current_channel,
\ 'protocol' : s:protocol, \ 'protocol' : s:protocol,
\ } \ }
endfunction endfunction