mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-07-24 22:45:12 +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
|
||||
endif
|
||||
|
||||
function! airline#extensions#bookmark#currentbookmark()
|
||||
function! airline#extensions#bookmark#currentbookmark() abort
|
||||
if get(w:, 'airline_active', 0)
|
||||
let file = expand("%:p")
|
||||
if file ==# ""
|
||||
return
|
||||
endif
|
||||
let file = expand('%:p')
|
||||
if file ==# ''
|
||||
return
|
||||
endif
|
||||
|
||||
let current_line = 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 annotation = has_bm ? bm['annotation'] : ""
|
||||
let current_line = 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 annotation = has_bm ? bm['annotation'] : ''
|
||||
|
||||
return annotation
|
||||
endif
|
||||
return annotation
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#bookmark#init(ext)
|
||||
function! airline#extensions#bookmark#init(ext) abort
|
||||
call airline#parts#define_function('bookmark', 'airline#extensions#bookmark#currentbookmark')
|
||||
endfunction
|
||||
|
Loading…
x
Reference in New Issue
Block a user