Simplify buffer deletion for g:startify_session_delete_buffers
This commit is contained in:
parent
2cdbe64a7d
commit
423eb03de4
|
@ -365,22 +365,9 @@ endfunction
|
||||||
|
|
||||||
" Function: #session_delete_buffers {{{1
|
" Function: #session_delete_buffers {{{1
|
||||||
function! startify#session_delete_buffers()
|
function! startify#session_delete_buffers()
|
||||||
if !get(g:, 'startify_session_delete_buffers', 1)
|
if get(g:, 'startify_session_delete_buffers', 1)
|
||||||
return
|
silent %bdelete
|
||||||
endif
|
endif
|
||||||
let n = 1
|
|
||||||
while n <= bufnr('$')
|
|
||||||
if buflisted(n)
|
|
||||||
try
|
|
||||||
silent execute 'bdelete' n
|
|
||||||
catch
|
|
||||||
echohl ErrorMsg
|
|
||||||
echomsg v:exception
|
|
||||||
echohl NONE
|
|
||||||
endtry
|
|
||||||
endif
|
|
||||||
let n += 1
|
|
||||||
endwhile
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Function: #session_list {{{1
|
" Function: #session_list {{{1
|
||||||
|
|
|
@ -317,8 +317,8 @@ Example:
|
||||||
<
|
<
|
||||||
Automatically update sessions in two cases:
|
Automatically update sessions in two cases:
|
||||||
|
|
||||||
1) Before leaving Vim
|
- Before leaving Vim
|
||||||
2) Before loading a new session via :SLoad
|
- Before loading a new session via :SLoad
|
||||||
|
|
||||||
This also works for sessions started with:
|
This also works for sessions started with:
|
||||||
>
|
>
|
||||||
|
@ -329,12 +329,12 @@ This also works for sessions started with:
|
||||||
>
|
>
|
||||||
let g:startify_session_delete_buffers = 1
|
let g:startify_session_delete_buffers = 1
|
||||||
<
|
<
|
||||||
Delete all listed buffers when loading or closing a session.
|
Delete all buffers when loading or closing a session:
|
||||||
|
|
||||||
1. When using |startify-:SLoad|.
|
- When using |startify-:SLoad|.
|
||||||
2. When using |startify-:SClose|.
|
- When using |startify-:SClose|.
|
||||||
3. When using |g:startify_session_autoload|.
|
- When using |g:startify_session_autoload|.
|
||||||
4. When choosing a session from the Startify buffer.
|
- When choosing a session from the Startify buffer.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*g:startify_change_to_dir*
|
*g:startify_change_to_dir*
|
||||||
|
|
Loading…
Reference in a new issue