mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-29 12:16:01 +08:00
style: rename inconsistent function names
This commit is contained in:
parent
148eb6bb28
commit
4265798d4b
|
@ -22,7 +22,7 @@ function! s:init()
|
||||||
if s:theme_in_vimrc
|
if s:theme_in_vimrc
|
||||||
try
|
try
|
||||||
if g:airline_theme is# 'random'
|
if g:airline_theme is# 'random'
|
||||||
let g:airline_theme=s:RandomTheme()
|
let g:airline_theme=s:random_theme()
|
||||||
endif
|
endif
|
||||||
let palette = g:airline#themes#{g:airline_theme}#palette
|
let palette = g:airline#themes#{g:airline_theme}#palette
|
||||||
catch
|
catch
|
||||||
|
@ -176,7 +176,7 @@ function! s:airline_theme(...)
|
||||||
try
|
try
|
||||||
let theme = a:1
|
let theme = a:1
|
||||||
if theme is# 'random'
|
if theme is# 'random'
|
||||||
let theme = s:RandomTheme()
|
let theme = s:random_theme()
|
||||||
endif
|
endif
|
||||||
call airline#switch_theme(theme)
|
call airline#switch_theme(theme)
|
||||||
catch " discard error
|
catch " discard error
|
||||||
|
@ -225,7 +225,7 @@ function! s:airline_extensions()
|
||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:Rand(max) abort
|
function! s:rand(max) abort
|
||||||
if has("reltime")
|
if has("reltime")
|
||||||
let timerstr=reltimestr(reltime())
|
let timerstr=reltimestr(reltime())
|
||||||
let number=split(timerstr, '\.')[1]+0
|
let number=split(timerstr, '\.')[1]+0
|
||||||
|
@ -239,9 +239,9 @@ function! s:Rand(max) abort
|
||||||
return number % a:max
|
return number % a:max
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:RandomTheme() abort
|
function! s:random_theme() abort
|
||||||
let themes=airline#util#themes('')
|
let themes=airline#util#themes('')
|
||||||
return themes[s:Rand(len(themes))]
|
return themes[s:rand(len(themes))]
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
command! -bar -nargs=? -complete=customlist,<sid>get_airline_themes AirlineTheme call <sid>airline_theme(<f-args>)
|
command! -bar -nargs=? -complete=customlist,<sid>get_airline_themes AirlineTheme call <sid>airline_theme(<f-args>)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user