Commits

ZyX_I committed 9aeebe8

Added aurumgraphlog_closewindow option

  • Participants
  • Parent commits 07556e1

Comments (0)

Files changed (1)

File ftplugin/aurumgraphlog.vim

 let s:_options={
             \'ignorefiles': {'default': [],
             \                'checker': 'list in [patch renames diff]'},
+            \'closewindow': {'default': 1, 'filter': 'bool'},
         \}
 "▶1 bisect :: [a], function + self → a
 function s:F.bisect(list, function)
     endfor
     return 0
 endfunction
+"▶1 cwin
+function s:F.cwin()
+    return s:_f.getoption('closewindow')?
+                \":wincmd c\n":
+                \":new\n"
+endfunction
 "▶1 cr
 function s:F.cr(...)
     "▶2 Get changeset, current special, encode options
         let cmd='edit '.fnameescape('aurum://diff:'.epath.':'.hex)
     endif
     "▲3
-    return ":wincmd c\n:".cmd."\n"
+    return s:F.cwin().":".cmd."\n"
 endfunction
 "▶1 gethexfile
 function s:F.gethexfile()
     endif
     let bvar=s:_r.aurum.bufvars[bufnr('%')]
     let epath=escape(bvar.repo.path, ':\')
-    return ":wincmd c\n:edit ".
+    return s:F.cwin().":edit ".
                 \fnameescape('aurum://file:'.epath.':'.hex.':'.file)."\n"
 endfunction
 "▶1 annotate
     let cs=bvar.repo.changesets[hex]
     let epath=escape(bvar.repo.path, ':\')
     if a:0 && a:1
-        return ":wincmd c\n:edit ".
+        return s:F.cwin().":edit ".
                     \fnameescape(s:_r.os.path.join(bvar.repo.path, file))."\n".
                     \':diffsplit '.fnameescape('aurum://file:'.epath.':'.
                     \                          hex.':'.file)."\n"
     elseif !empty(cs.parents)
-        return ":wincmd c\n:edit ".
+        return s:F.cwin().":edit ".
                     \fnameescape('aurum://file:'.epath.':'.hex.':'.file)."\n".
                     \':diffsplit '.fnameescape('aurum://file:'.epath.':'.
                     \                          cs.parents[0].':'.file)."\n"