Merge pull request #22 from simplay/visualize-file-modified
Indicate in airline that the current buffer has unsaved changes
This commit is contained in:
commit
891810846e
1 changed files with 12 additions and 0 deletions
|
@ -31,6 +31,9 @@ let s:guiBlack = "#282a36"
|
|||
let s:ctermWhite = "15"
|
||||
let s:ctermBlack = "16"
|
||||
|
||||
let s:ctermChangedColor = "59"
|
||||
let s:guiChangedColor = "#5f5f5f"
|
||||
|
||||
" Normal mode
|
||||
let s:N1 = [ s:guiBlack , s:gui08 , s:ctermBlack , s:cterm08 ]
|
||||
let s:N2 = [ s:guiWhite , s:gui02 , s:ctermWhite , s:cterm02 ]
|
||||
|
@ -51,6 +54,9 @@ let s:R1 = [ s:guiBlack , s:gui05 , s:ctermWhite, s:cterm05 ]
|
|||
let s:R2 = [ s:guiWhite , s:gui02 , s:ctermWhite, s:cterm02 ]
|
||||
let s:R3 = [ s:guiWhite , s:gui01 , s:ctermWhite, s:cterm01 ]
|
||||
|
||||
" File changed
|
||||
let s:changed = [ s:guiWhite , s:guiChangedColor , s:ctermWhite , s:ctermChangedColor ]
|
||||
|
||||
let g:airline#themes#dracula#palette = {}
|
||||
let g:airline#themes#dracula#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#dracula#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
|
@ -78,6 +84,12 @@ let g:airline#themes#dracula#palette.insert.airline_error = s:ERROR
|
|||
let g:airline#themes#dracula#palette.visual.airline_error = s:ERROR
|
||||
let g:airline#themes#dracula#palette.replace.airline_error = s:ERROR
|
||||
|
||||
" File modified and not saved
|
||||
let g:airline#themes#dracula#palette.normal_modified = airline#themes#generate_color_map(s:N1, s:N2, s:changed)
|
||||
let g:airline#themes#dracula#palette.insert_modified = airline#themes#generate_color_map(s:I1, s:I2, s:changed)
|
||||
let g:airline#themes#dracula#palette.replace_modified = airline#themes#generate_color_map(s:R1, s:R2, s:changed)
|
||||
let g:airline#themes#dracula#palette.visual_modified = airline#themes#generate_color_map(s:V1, s:V2, s:changed)
|
||||
|
||||
" CtrlP
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
|
|
Loading…
Reference in a new issue