Commits

ZyX_I committed 5899791

@aurum/record: Made s:F.edit() also save diff-related options
Made AuRecord Edit mapping do diffoff!
Should fix #14

  • Participants
  • Parent commits 6fed342
  • Tags release-1.4.6

Comments (0)

Files changed (1)

plugin/aurum/record.vim

     return [lwnr, rwnr, swnr]
 endfunction
 "▶1 edit
+let s:savedopts=['readonly', 'modifiable', 'scrollbind', 'cursorbind',
+            \    'scrollopt', 'wrap', 'foldmethod', 'foldcolumn']
 function s:F.edit(bvar, fname, ro)
     if type(a:fname)==type('')
         " XXX Do not handle existance of aurum://edit and aurum://copy buffers: 
     endif
     let buf=bufnr('%')
     if existed
-        let a:bvar.oldbufs[buf]={'readonly': &readonly,
-                    \          'modifiable': &modifiable,}
+        if !has_key(a:bvar.oldbufs, buf)
+            let savedopts={'diff': 0}
+            let a:bvar.oldbufs[buf]=savedopts
+            for o in s:savedopts
+                let savedopts[o]=getbufvar(buf, '&'.o)
+            endfor
+        endif
     else
         setlocal bufhidden=wipe
     endif
         let status=bvar.statuses[line('.')-1]
         let modified=status%2
         execute lwnr.'wincmd w'
+        diffoff!
         let fullpath=s:_r.os.path.join(bvar.repo.path, file)
         let ntype=get(s:ntypes, type, 0)
         if !modified