ZyX_I avatar ZyX_I committed 32498ad

@aurum/vimdiff: Fixed inappropriate behavior in case of two subsequent :AuVimDiff calls with first having modifications to file during viewing diffsplit with g:aurum_usewin and &hidden on
Fixes #26

Comments (0)

Files changed (3)

plugin/aurum/vimdiff.vim

         elseif !has_key(dbvar, 'diffsaved')
             return
         endif
-        augroup AurumDiff
+        augroup AuVimDiff
             autocmd! BufEnter <buffer>
         augroup END
+        unlet t:auvimdiff_origbufvar
         if b:changedtick!=dbvar.diffsaved.changedtick
             return
         endif
             endtry
         endfor
         call setpos('.', curpos)
-        unlet dbvar.diffsaved
-        unlet t:auvimdiff_origbufvar
-        augroup AuVimDiff
-            autocmd! BufEnter <buffer>
-        augroup END
     else
         for option in s:diffsaveopts
             call setbufvar(a:buf, '&'.option, dbvar.diffsaved[option])

test/regression-vimdiff-nodiffoff.in

+:let g:aurum_usewin=1
+:set hidden
+:set splitright
+:set diffopt+=vertical
+:R edit   emerged.lst
+:R vsplit ablines.lst
+:wincmd p
+:AuVimDiff
+zR5ggdd,X:AuVimDiff
+,X:WW

test/regression-vimdiff-nodiffoff.ok

+*1: %TMPDIR%/test/regression-vimdiff-nodiffoffrepo/emerged.lst
+#2: %TMPDIR%/test/regression-vimdiff-nodiffoffrepo/ablines.lst
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.