Skip to content

Commit

Permalink
When autosave is enabled, pull swap functionality by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
thaerkh committed Aug 13, 2017
1 parent 27c6ac2 commit e5450e9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugin/workspace.vim
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,13 @@ function! s:SetAutosave(enable)
if a:enable == 1
let s:autoread = &autoread
let s:autowriteall = &autowriteall
let s:swapfile = &swapfile
let s:swapsync = &swapsync
let s:updatetime = &updatetime
set autoread
set autowriteall
set noswapfile
set swapsync=""
set updatetime=1000
augroup WorkspaceToggle
au! BufLeave,FocusLost,FocusGained,InsertLeave * call s:Autosave(0)
Expand All @@ -162,6 +166,8 @@ function! s:SetAutosave(enable)
let &autoread = s:autoread
let &autowriteall = s:autowriteall
let &updatetime = s:updatetime
let &swapfile = s:swapfile
let &swapsync = s:swapsync
au! WorkspaceToggle * *
let s:autosave_on = 0
endif
Expand Down

0 comments on commit e5450e9

Please sign in to comment.