Source

aurum / autoload / aurum / record.vim

Diff from to

File autoload/aurum/record.vim

             \'removed':  'r',
             \'deleted':  'r',
         \}
+function s:F.restorefiles(bvar, sline, eline)
+    for file in map(range(a:sline, a:eline), 'a:bvar.lines[v:val-1][2:]')
+        let fullpath=s:_r.os.path.join(a:bvar.repo.path, file)
+        let backupfile=remove(a:bvar.filesbackup, fullpath)
+        call remove(a:bvar.backupfiles, backupfile)
+        call s:F.restorebackup(fullpath, backupfile)
+    endfor
+endfunction
 function s:F.runstatmap(action, ...)
     "▶2 buf, bvar, reset
     let buf=get(a:000, 0, bufnr('%'))
             if add
                 if status<2
                     let status+=2
+                elseif status==3
+                    let status=2
+                    call s:F.restorefiles(bvar, sline, eline)
                 endif
             else
                 if status>1
                     let status-=2
+                elseif status==1
+                    let status=0
+                    call s:F.restorefiles(bvar, sline, eline)
                 endif
             endif
             if oldstatus==status