mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-17 07:43:44 -05:00
Don't set readonly globally
This commit is contained in:
@@ -1661,7 +1661,7 @@ function! fugitive#BufReadCmd(...) abort
|
||||
let error = b:fugitive_type
|
||||
unlet b:fugitive_type
|
||||
if rev =~# '^:\d:'
|
||||
let &readonly = !filewritable(dir . '/index')
|
||||
let &l:readonly = !filewritable(dir . '/index')
|
||||
return 'silent doautocmd BufNewFile'
|
||||
else
|
||||
setlocal readonly nomodifiable
|
||||
@@ -1731,7 +1731,7 @@ function! fugitive#BufReadCmd(...) abort
|
||||
keepjumps call setpos('.',pos)
|
||||
setlocal nomodified noswapfile
|
||||
let modifiable = rev =~# '^:.:' && b:fugitive_type !=# 'tree'
|
||||
let &readonly = !modifiable || !filewritable(dir . '/index')
|
||||
let &l:readonly = !modifiable || !filewritable(dir . '/index')
|
||||
if &bufhidden ==# ''
|
||||
setlocal bufhidden=delete
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user