Commits

ZyX_I committed a75f890

Made all :AuStatus mappings close status window before proceeding, added tests for aurumstatus mappings

Comments (0)

Files changed (3)

ftplugin/aurumstatus.vim

     if index(s:noacttypes[a:action], bvar.types[line('.')-1])!=-1
         return ''
     endif
+    let r=":wincmd c\n"
     if a:action is# 'open'
-        return ':edit '.fnameescape(s:_r.os.path.join(bvar.repo.path,file))."\n"
+        let r.=':edit '.fnameescape(s:_r.os.path.join(bvar.repo.path,file))."\n"
     elseif a:action is# 'revopen'
-        return ':e '.fnameescape('aurum://file:'.epath.':'.rev1.':'.file)."\n"
+        let r.=':e '.fnameescape('aurum://file:'.epath.':'.rev1.':'.file)."\n"
     elseif a:action is# 'diff'
-        return ':edit '.fnameescape('aurum://diff:'.epath.':'.rev1.':'.rev2.':'.
+        let r.=':edit '.fnameescape('aurum://diff:'.epath.':'.rev1.':'.rev2.':'.
                     \               escape(file, '\;:')."\n")
     elseif a:action is# 'vimdiff'
         if empty(rev2)
         else
             let file2=fnameescape('aurum://file:'.epath.':'.rev2.':'.file)
         endif
-        return ':edit '.fnameescape('aurum://file:'.epath.':'.rev1.':'.file).
+        let r.=':edit '.fnameescape('aurum://file:'.epath.':'.rev1.':'.file).
                     \"\n:diffsplit ".file2."\n"
     endif
+    return r
 endfunction
 "▶1 AuStatus mapping group
 call s:_f.mapgroup.add('AuStatus', {
+:call mkdir(g:curtest.'repo')
+:execute '!tar c -C testrepo . | (cd '.g:curtest.'repo && tar x)'
+:W <CR>
+:cd `=g:curtest.'repo'`
+:AuStatus
+/^M
+
+:call WriteFile(bufname('%'))
+:bwipeout!
+:W o
+:AuStatus
+/^M
+o:call WriteFile(bufname('%'))
+:bwipeout!
+:W d
+:AuStatus
+/^M
+d:call WriteFile(bufname('%'))
+:bwipeout!
+:W D
+:AuStatus
+/^M
+D:call WriteFile(bufname('%'), 'w$: '.winnr('$').', d:'.&diff)
+<CR>
+/home/zyx/a.a/.settings/home/.vim/dev/repository/tmp/test/statmapsrepo/nohglinesrev.lst
+o
+aurum://file:/home/zyx/a.a/.settings/home/.vim/dev/repository/tmp/test/statmapsrepo:.:nohglinesrev.lst
+d
+aurum://diff:/home/zyx/a.a/.settings/home/.vim/dev/repository/tmp/test/statmapsrepo:.::nohglinesrev.lst\
+D
+/home/zyx/a.a/.settings/home/.vim/dev/repository/tmp/test/statmapsrepo/nohglinesrev.lst
+w$: 2, d:1