changeset 96:1ea783dd06dd

Fix typo bug, annotate window width.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 24 Jul 2014 10:37:08 -0700
parents d38be34b403b
children e8b115e595d1
files plugin/lawrencium.vim
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/plugin/lawrencium.vim	Wed Jul 23 21:39:41 2014 -0700
+++ b/plugin/lawrencium.vim	Thu Jul 24 10:37:08 2014 -0700
@@ -643,7 +643,7 @@
 
 " Annotate file
 function! s:read_lawrencium_annotate(repo, path_parts, full_path) abort
-    let l:cmd_args = ['-c', '-n', '-u', '-d', 'q']
+    let l:cmd_args = ['-c', '-n', '-u', '-d', '-q']
     if a:path_parts['value'] == 'v=1'
         call insert(l:cmd_args, '-v', 0)
     endif
@@ -1671,7 +1671,7 @@
 
 " }}}
 
-" Hgannotate {{{
+" Hgannotate, Hgwannotate {{{
 
 function! s:HgAnnotate(bang, verbose, ...) abort
     " Open the file to annotate if needed.
@@ -1736,11 +1736,17 @@
         syncbind
 
         " Set the correct window width for the annotations.
-        let l:last_token = match(getline('.'), '\v\d{4}:\s')
+        if a:verbose
+            let l:last_token = match(getline('.'), '\v\d{4}:\s')
+            let l:token_end = 5
+        else
+            let l:last_token = match(getline('.'), '\v\d{2}:\s')
+            let l:token_end = 3
+        endif
         if l:last_token < 0
             echoerr "Can't find the end of the annotation columns."
         else
-            let l:column_count = l:last_token + 4 + g:lawrencium_annotate_width_offset
+            let l:column_count = l:last_token + l:token_end + g:lawrencium_annotate_width_offset
             execute "vertical resize " . l:column_count
             setlocal winfixwidth
         endif