1. nick brown
  2. aurum


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
  • Branches default
  • Tags release-1.4.6

Comments (0)

Files changed (1)

File plugin/aurum/record.vim

View file
     return [lwnr, rwnr, swnr]
 "▶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: 
     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
         setlocal bufhidden=wipe
         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