mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-17 15:53:43 -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
|
let error = b:fugitive_type
|
||||||
unlet b:fugitive_type
|
unlet b:fugitive_type
|
||||||
if rev =~# '^:\d:'
|
if rev =~# '^:\d:'
|
||||||
let &readonly = !filewritable(dir . '/index')
|
let &l:readonly = !filewritable(dir . '/index')
|
||||||
return 'silent doautocmd BufNewFile'
|
return 'silent doautocmd BufNewFile'
|
||||||
else
|
else
|
||||||
setlocal readonly nomodifiable
|
setlocal readonly nomodifiable
|
||||||
@@ -1731,7 +1731,7 @@ function! fugitive#BufReadCmd(...) abort
|
|||||||
keepjumps call setpos('.',pos)
|
keepjumps call setpos('.',pos)
|
||||||
setlocal nomodified noswapfile
|
setlocal nomodified noswapfile
|
||||||
let modifiable = rev =~# '^:.:' && b:fugitive_type !=# 'tree'
|
let modifiable = rev =~# '^:.:' && b:fugitive_type !=# 'tree'
|
||||||
let &readonly = !modifiable || !filewritable(dir . '/index')
|
let &l:readonly = !modifiable || !filewritable(dir . '/index')
|
||||||
if &bufhidden ==# ''
|
if &bufhidden ==# ''
|
||||||
setlocal bufhidden=delete
|
setlocal bufhidden=delete
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user