Mercurial > vim-lawrencium
comparison plugin/lawrencium.vim @ 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 | e5ac6464a767 |
comparison
equal
deleted
inserted
replaced
95:d38be34b403b | 96:1ea783dd06dd |
---|---|
641 setlocal nofoldenable | 641 setlocal nofoldenable |
642 endfunction | 642 endfunction |
643 | 643 |
644 " Annotate file | 644 " Annotate file |
645 function! s:read_lawrencium_annotate(repo, path_parts, full_path) abort | 645 function! s:read_lawrencium_annotate(repo, path_parts, full_path) abort |
646 let l:cmd_args = ['-c', '-n', '-u', '-d', 'q'] | 646 let l:cmd_args = ['-c', '-n', '-u', '-d', '-q'] |
647 if a:path_parts['value'] == 'v=1' | 647 if a:path_parts['value'] == 'v=1' |
648 call insert(l:cmd_args, '-v', 0) | 648 call insert(l:cmd_args, '-v', 0) |
649 endif | 649 endif |
650 call add(l:cmd_args, a:full_path) | 650 call add(l:cmd_args, a:full_path) |
651 call a:repo.ReadCommandOutput('annotate', l:cmd_args) | 651 call a:repo.ReadCommandOutput('annotate', l:cmd_args) |
1669 call s:AddMainCommand("-nargs=* -complete=customlist,s:ListRepoFiles Hglog :call s:HgLog(0, <f-args>)") | 1669 call s:AddMainCommand("-nargs=* -complete=customlist,s:ListRepoFiles Hglog :call s:HgLog(0, <f-args>)") |
1670 call s:AddMainCommand("-nargs=* -complete=customlist,s:ListRepoFiles Hgvlog :call s:HgLog(1, <f-args>)") | 1670 call s:AddMainCommand("-nargs=* -complete=customlist,s:ListRepoFiles Hgvlog :call s:HgLog(1, <f-args>)") |
1671 | 1671 |
1672 " }}} | 1672 " }}} |
1673 | 1673 |
1674 " Hgannotate {{{ | 1674 " Hgannotate, Hgwannotate {{{ |
1675 | 1675 |
1676 function! s:HgAnnotate(bang, verbose, ...) abort | 1676 function! s:HgAnnotate(bang, verbose, ...) abort |
1677 " Open the file to annotate if needed. | 1677 " Open the file to annotate if needed. |
1678 if a:0 > 0 | 1678 if a:0 > 0 |
1679 call s:HgEdit(a:bang, a:1) | 1679 call s:HgEdit(a:bang, a:1) |
1734 normal! zt | 1734 normal! zt |
1735 execute l:cur_line | 1735 execute l:cur_line |
1736 syncbind | 1736 syncbind |
1737 | 1737 |
1738 " Set the correct window width for the annotations. | 1738 " Set the correct window width for the annotations. |
1739 let l:last_token = match(getline('.'), '\v\d{4}:\s') | 1739 if a:verbose |
1740 let l:last_token = match(getline('.'), '\v\d{4}:\s') | |
1741 let l:token_end = 5 | |
1742 else | |
1743 let l:last_token = match(getline('.'), '\v\d{2}:\s') | |
1744 let l:token_end = 3 | |
1745 endif | |
1740 if l:last_token < 0 | 1746 if l:last_token < 0 |
1741 echoerr "Can't find the end of the annotation columns." | 1747 echoerr "Can't find the end of the annotation columns." |
1742 else | 1748 else |
1743 let l:column_count = l:last_token + 4 + g:lawrencium_annotate_width_offset | 1749 let l:column_count = l:last_token + l:token_end + g:lawrencium_annotate_width_offset |
1744 execute "vertical resize " . l:column_count | 1750 execute "vertical resize " . l:column_count |
1745 setlocal winfixwidth | 1751 setlocal winfixwidth |
1746 endif | 1752 endif |
1747 endif | 1753 endif |
1748 | 1754 |