mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-07-27 07:54:44 +02:00
Merge pull request #2276 from kazukazuinaina/fix_indent_bookmark_extension
[fix] bookmark extension's indentation and add abort
This commit is contained in:
commit
5f2421fa39
@ -8,23 +8,23 @@ if !exists(':BookmarkToggle')
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
function! airline#extensions#bookmark#currentbookmark()
|
function! airline#extensions#bookmark#currentbookmark() abort
|
||||||
if get(w:, 'airline_active', 0)
|
if get(w:, 'airline_active', 0)
|
||||||
let file = expand("%:p")
|
let file = expand('%:p')
|
||||||
if file ==# ""
|
if file ==# ''
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let current_line = line('.')
|
let current_line = line('.')
|
||||||
let has_bm = bm#has_bookmark_at_line(file, current_line)
|
let has_bm = bm#has_bookmark_at_line(file, current_line)
|
||||||
let bm = has_bm ? bm#get_bookmark_by_line(file, current_line) : 0
|
let bm = has_bm ? bm#get_bookmark_by_line(file, current_line) : 0
|
||||||
let annotation = has_bm ? bm['annotation'] : ""
|
let annotation = has_bm ? bm['annotation'] : ''
|
||||||
|
|
||||||
return annotation
|
return annotation
|
||||||
endif
|
endif
|
||||||
return ''
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! airline#extensions#bookmark#init(ext)
|
function! airline#extensions#bookmark#init(ext) abort
|
||||||
call airline#parts#define_function('bookmark', 'airline#extensions#bookmark#currentbookmark')
|
call airline#parts#define_function('bookmark', 'airline#extensions#bookmark#currentbookmark')
|
||||||
endfunction
|
endfunction
|
||||||
|
Loading…
x
Reference in New Issue
Block a user