changeset 68:7afcd4d37062

Added vertical `Hglog` commands.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 05 Mar 2013 21:01:05 -0800
parents 1cf08e4a7947
children 8c9aca0e4322
files plugin/lawrencium.vim
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/plugin/lawrencium.vim	Mon Nov 26 21:07:43 2012 -0800
+++ b/plugin/lawrencium.vim	Tue Mar 05 21:01:05 2013 -0800
@@ -1314,7 +1314,7 @@
 
 " 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()
@@ -1327,7 +1327,11 @@
     " 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.
@@ -1403,8 +1407,10 @@
     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>)")
 
 " }}}