mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-12-06 12:14:24 +08:00
Add executable status (#2723)
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
CI / Test (v9.1.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
CI / Test (v9.1.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled
closes: #2722
This commit is contained in:
committed by
GitHub
parent
7fc376a4d5
commit
41c5f54507
@@ -136,6 +136,7 @@ function! airline#init#bootstrap()
|
||||
\ 'notexists': "\u0246",
|
||||
\ 'dirty': "\u26a1",
|
||||
\ 'crypt': nr2char(0x1F512),
|
||||
\ 'executable': "\u2699",
|
||||
\ }, 'keep')
|
||||
" Note: If "\u2046" (Ɇ) does not show up, try to use "\u2204" (∄)
|
||||
if exists("*setcellwidths")
|
||||
@@ -160,6 +161,7 @@ function! airline#init#bootstrap()
|
||||
\ 'notexists': "\u0246",
|
||||
\ 'crypt': nr2char(0x1F512),
|
||||
\ 'dirty': '!',
|
||||
\ 'executable': "\u2699",
|
||||
\ }, 'keep')
|
||||
else
|
||||
" Symbols for ASCII terminals
|
||||
@@ -177,6 +179,7 @@ function! airline#init#bootstrap()
|
||||
\ 'notexists': '?',
|
||||
\ 'crypt': 'cr',
|
||||
\ 'dirty': '!',
|
||||
\ 'executable': 'x',
|
||||
\ }, 'keep')
|
||||
endif
|
||||
|
||||
@@ -189,6 +192,7 @@ function! airline#init#bootstrap()
|
||||
call airline#parts#define_function('crypt', 'airline#parts#crypt')
|
||||
call airline#parts#define_function('spell', 'airline#parts#spell')
|
||||
call airline#parts#define_function('filetype', 'airline#parts#filetype')
|
||||
call airline#parts#define_function('executable', 'airline#parts#executable')
|
||||
call airline#parts#define('readonly', {
|
||||
\ 'function': 'airline#parts#readonly',
|
||||
\ 'accent': 'red',
|
||||
@@ -253,7 +257,7 @@ endfunction
|
||||
function! airline#init#sections()
|
||||
let spc = g:airline_symbols.space
|
||||
if !exists('g:airline_section_a')
|
||||
let g:airline_section_a = airline#section#create_left(['mode', 'crypt', 'paste', 'keymap', 'spell', 'capslock', 'xkblayout', 'iminsert'])
|
||||
let g:airline_section_a = airline#section#create_left(['mode', 'crypt', 'paste', 'keymap', 'spell', 'capslock', 'xkblayout', 'iminsert', 'executable'])
|
||||
endif
|
||||
if !exists('g:airline_section_b')
|
||||
if airline#util#winwidth() > 99
|
||||
|
||||
@@ -206,3 +206,11 @@ function! airline#parts#ffenc()
|
||||
return &fenc.bomb.noeolf.ff
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#parts#executable()
|
||||
if exists("*getfperm") && getfperm(bufname('%')) =~ 'x'
|
||||
return g:airline_symbols.executable
|
||||
else
|
||||
return ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user