Skip to content
Browse files

Do not set 'bexpr' for unrelated buffers.

Users may have defined their own 'bexpr', and may want to keep that in all other buffers. Use :setlocal instead of :set to set the global-local option only for the on-disk and recovered buffers.
  • Loading branch information...
1 parent c4df69f commit 2f5734e79a02e86109614dd7408163392ee32c9d @inkarkat committed Aug 12, 2012
Showing with 10 additions and 5 deletions.
  1. +10 −5 autoload/recover.vim
15 autoload/recover.vim
@@ -116,6 +116,10 @@ fu! recover#DiffRecoveredFile() "{{{1
let b:mod='recovered version'
let l:filetype = &ft
+ if has("balloon_eval")
+ set ballooneval
+ setl bexpr=recover#BalloonExprRecover()
+ endif
" saved version
let curspr = &spr
set nospr
@@ -132,13 +136,14 @@ fu! recover#DiffRecoveredFile() "{{{1
setl noswapfile buftype=nowrite bufhidden=delete nobuflisted
let b:mod='unmodified version on-disk'
let swapbufnr=bufnr('')
+ if has("balloon_eval")
+ set ballooneval
+ setl bexpr=recover#BalloonExprRecover()
+ endif
noa wincmd l
let b:swapbufnr = swapbufnr
command! -buffer RecoverPluginFinish :FinishRecovery
command! -buffer FinishRecovery :call recover#RecoverFinish()
- if has("balloon_eval")
- set ballooneval bexpr=recover#BalloonExprRecover()
- endif
setl modified
@@ -267,8 +272,8 @@ fu! recover#DiffRecoveredFileOld() "{{{2
call feedkeys(":command! -buffer FinishRecovery :call recover#RecoverFinish()\n", 't')
call feedkeys(":0\n", 't')
if has("balloon_eval")
- "call feedkeys(':if has("balloon_eval")|:set ballooneval|set bexpr=recover#BalloonExprRecover()|endif'."\n", 't')
- call feedkeys(":set ballooneval|set bexpr=recover#BalloonExprRecover()\n", 't')
+ "call feedkeys(':if has("balloon_eval")|:set ballooneval|setl bexpr=recover#BalloonExprRecover()|endif'."\n", 't')
+ call feedkeys(":set ballooneval|setl bexpr=recover#BalloonExprRecover()\n", 't')
"call feedkeys(":redraw!\n", 't')
call feedkeys(":for i in range(".histnr.", histnr('cmd'), 1)|:call histdel('cmd',i)|:endfor\n",'t')

0 comments on commit 2f5734e

Please sign in to comment.
Something went wrong with that request. Please try again.