# HG changeset patch # User Ludovic Chabant # Date 1406223428 25200 # Node ID 1ea783dd06ddb484796a850208930e6bf145bfa0 # Parent d38be34b403b714545c5a3275887d2f4b873c120 Fix typo bug, annotate window width. diff -r d38be34b403b -r 1ea783dd06dd plugin/lawrencium.vim --- 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