Make buffer readonly
This is done to avoid accidentally saving the Startify buffer to disk. For why Startify is not using buftype=nofile in the first place, see `:h startify-faq-05`. References #265.
This commit is contained in:
parent
44be5fc486
commit
5c4ed4a34a
|
@ -53,6 +53,7 @@ function! startify#insane_in_the_membrane() abort
|
||||||
|
|
||||||
silent! setlocal
|
silent! setlocal
|
||||||
\ bufhidden=wipe
|
\ bufhidden=wipe
|
||||||
|
\ colorcolumn=
|
||||||
\ nobuflisted
|
\ nobuflisted
|
||||||
\ nocursorcolumn
|
\ nocursorcolumn
|
||||||
\ nocursorline
|
\ nocursorline
|
||||||
|
@ -61,7 +62,7 @@ function! startify#insane_in_the_membrane() abort
|
||||||
\ norelativenumber
|
\ norelativenumber
|
||||||
\ nospell
|
\ nospell
|
||||||
\ noswapfile
|
\ noswapfile
|
||||||
\ colorcolumn=
|
\ readonly
|
||||||
if empty(&statusline)
|
if empty(&statusline)
|
||||||
setlocal statusline=\ startify
|
setlocal statusline=\ startify
|
||||||
endif
|
endif
|
||||||
|
@ -765,7 +766,7 @@ function! s:set_mark(type, ...) abort
|
||||||
\ 'T': 'tabnew',
|
\ 'T': 'tabnew',
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
setlocal modifiable
|
setlocal noreadonly modifiable
|
||||||
|
|
||||||
if entry.marked && index[0] == a:type
|
if entry.marked && index[0] == a:type
|
||||||
let entry.cmd = 'edit'
|
let entry.cmd = 'edit'
|
||||||
|
@ -779,7 +780,7 @@ function! s:set_mark(type, ...) abort
|
||||||
execute 'normal! ci]'. repeat(a:type, len(index))
|
execute 'normal! ci]'. repeat(a:type, len(index))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
setlocal nomodifiable nomodified
|
setlocal readonly nomodifiable nomodified
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Function: s:sort_by_tick {{{1
|
" Function: s:sort_by_tick {{{1
|
||||||
|
|
Loading…
Reference in a new issue