@@ -15,7 +15,7 @@ func! s:Configure() abort
15
15
let g: lightline .active = {
16
16
\ ' left' : [ [ ' mode' ],
17
17
\ [ ' vcs' ],
18
- \ [ ' fileicon ' , ' modified' , ' relativepath' ] ],
18
+ \ [ ' icon ' , ' modified' , ' relativepath' , ' filename ' ] ],
19
19
\ ' right' : [ [ ' paste' , ],
20
20
\ [ ' pos' , ' readonly' ],
21
21
\ [ ' lint' ] ] }
@@ -34,13 +34,14 @@ func! s:Configure() abort
34
34
\ ' pos' : ' %l:%c / B:%n W: %{winnr()}' ,
35
35
\ ' spell' : ' %{emoji#for("pencil")}%{&spelllang}' ,
36
36
\ ' lint' : ' %{jalcine#status#get("lint")}' ,
37
- \ ' vcs' : ' %{jalcine#status#get("vcs")}'
38
- \ }
39
- let g: lightline .component_function = {
40
- \ ' fileicon' : ' WebDevIconsGetFileTypeSymbol' ,
37
+ \ ' vcs' : ' %{jalcine#status#get("vcs")}' ,
38
+ \ ' icon' : ' %{jalcine#status#get("icon")}'
41
39
\ }
42
40
let g: lightline .component_visible_condition = {
43
- \ ' gitbranch' : ' fugitive#head() !== ""' ,
41
+ \ ' vcs' : ' fugitive#head() !== ""' ,
42
+ \ ' icon' : ' winwidth(0) > 70' ,
43
+ \ ' relativepath' : ' winwidth(0) > 70' ,
44
+ \ ' filename' : ' winwidth(0) < 70' ,
44
45
\ }
45
46
let g: lightline .separator = { ' left' : ' ' , ' right' : ' ' }
46
47
let g: lightline .subseparator = { ' left' : ' ' , ' right' : ' ' }
@@ -76,7 +77,9 @@ endfunction
76
77
77
78
func ! jalcine#status#get (part) abort
78
79
if a: part == ' vcs'
79
- if ! exists (' fugitive#head' ) | return | endif
80
+ if ! exists (' fugitive#head' )
81
+ return emoji#for (' copyright' )
82
+ endif
80
83
81
84
let l: name = fugitive#head (8 )
82
85
if empty (l: name )
@@ -86,6 +89,12 @@ func! jalcine#status#get(part) abort
86
89
endif
87
90
88
91
return l: name
92
+ elseif a: part == ' icon'
93
+ if ! strlen (&filetype )
94
+ return " "
95
+ endif
96
+
97
+ return WebDevIconsGetFileTypeSymbol ()
89
98
elseif a: part == ' lint'
90
99
let l: status = ale#statusline#Status ()
91
100
if l: status == " OK"
0 commit comments