Commits

Ludovic Chabant  committed 7afcd4d

Added vertical `Hglog` commands.

  • Participants
  • Parent commits 1cf08e4

Comments (0)

Files changed (1)

File plugin/lawrencium.vim

 
 " Hglog, Hglogthis {{{
 
-function! s:HgLog(...) abort
+function! s:HgLog(vertical, ...) abort
     " Get the file or directory to get the log from.
     " (empty string is for the whole repository)
     let l:repo = s:hg_repo()
     " Get the Lawrencium path for this `hg log`,
     " open it in a preview window and jump to it.
     let l:log_path = l:repo.GetLawrenciumPath(l:path, 'log', '')
-    execute 'pedit ' . l:log_path
+    if a:vertical
+        execute 'vertical pedit ' . l:log_path
+    else
+        execute 'pedit ' . l:log_path
+    endif
     wincmd P
 
     " Add some other nice commands and mappings.
     return l:rev
 endfunction
 
-call s:AddMainCommand("Hglogthis  :call s:HgLog('%:p')")
-call s:AddMainCommand("-nargs=? -complete=customlist,s:ListRepoFiles Hglog  :call s:HgLog(<f-args>)")
+call s:AddMainCommand("Hglogthis  :call s:HgLog(0, '%:p')")
+call s:AddMainCommand("Hgvlogthis :call s:HgLog(1, '%:p')")
+call s:AddMainCommand("-nargs=? -complete=customlist,s:ListRepoFiles Hglog  :call s:HgLog(0, <f-args>)")
+call s:AddMainCommand("-nargs=? -complete=customlist,s:ListRepoFiles Hgvlog  :call s:HgLog(1, <f-args>)")
 
 " }}}