# HG changeset patch # User Ludovic Chabant # Date 1352960490 28800 # Node ID 621185a5fa4800b0bdae0fe12903cd19b83e26b5 # Parent 220c9508ff62816dd4f2b8b8b3c90789150d689f Added ability to show diff summaries from the status window. diff -r 220c9508ff62 -r 621185a5fa48 plugin/lawrencium.vim --- a/plugin/lawrencium.vim Wed Nov 14 22:16:26 2012 -0800 +++ b/plugin/lawrencium.vim Wed Nov 14 22:21:30 2012 -0800 @@ -503,6 +503,8 @@ command! -buffer Hgstatusedit :call s:HgStatus_FileEdit() command! -buffer Hgstatusdiff :call s:HgStatus_Diff(0) command! -buffer Hgstatusvdiff :call s:HgStatus_Diff(1) + command! -buffer Hgstatusdiffsum :call s:HgStatus_DiffSummary(0) + command! -buffer Hgstatusvdiffsum :call s:HgStatus_DiffSummary(1) command! -buffer Hgstatusrefresh :call s:HgStatus_Refresh() command! -buffer -range Hgstatusaddremove :call s:HgStatus_AddRemove(, ) command! -buffer -range=% -bang Hgstatuscommit :call s:HgStatus_Commit(, , 0, 0) @@ -517,6 +519,8 @@ nnoremap :call search('^[MARC\!\?I ]\s.', 'Wbe') nnoremap :Hgstatusdiff nnoremap :Hgstatusvdiff + nnoremap :Hgstatusdiffsum + nnoremap :Hgstatusvdiffsum nnoremap :Hgstatusaddremove nnoremap :Hgstatuscommit nnoremap :Hgstatusrefresh @@ -592,6 +596,17 @@ call s:HgDiff('%:p', a:vertical) endfunction +function! s:HgStatus_DiffSummary(vertical) abort + " Get the path of the file the cursor is on. + let l:path = s:HgStatus_GetSelectedFile() + let l:split_type = 1 + if a:vertical + let l:split_type = 2 + endif + wincmd p + call s:HgDiffSummary(l:path, l:split_type) +endfunction + function! s:HgStatus_QNew(linestart, lineend, patchname, ...) abort " Get the selected filenames. let l:filenames = s:HgStatus_GetSelectedFiles(a:linestart, a:lineend, ['M', 'A', 'R'])