comparison plugins/hghelp/hghelp.vim @ 7:34930197e9d4

Updating hg diff tool. Adding support for global searching
author Luka Sitas <lsitas@avatarasoftware.com>
date Thu, 30 Oct 2025 13:45:31 -0400
parents 3017fd33ad8b
children 9c80955f0c6e
comparison
equal deleted inserted replaced
6:3017fd33ad8b 7:34930197e9d4
11 11
12 function! s:OpenHgDiff(file) 12 function! s:OpenHgDiff(file)
13 let l:current_file = a:file !=# '' ? a:file : expand('%') 13 let l:current_file = a:file !=# '' ? a:file : expand('%')
14 let l:filetype = &filetype 14 let l:filetype = &filetype
15 let l:temp_file = tempname() 15 let l:temp_file = tempname()
16 execute 'tabnew' 16 let l:command = 'hg cat -r . ' . l:current_file . ' > ' . l:temp_file
17 execute 'silent !hg cat -r . ' . l:current_file . ' > ' . l:temp_file 17 let result = system(l:command . ' 2>&1')
18 execute 'edit ' . l:temp_file 18 execute 'tabe ' . l:temp_file
19 execute 'setfiletype' l:filetype 19 execute 'setfiletype' l:filetype
20 setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile 20 setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile
21 execute 'vert diffsplit' l:current_file 21 execute 'vert diffsplit' l:current_file
22 endfunction 22 endfunction
23
24
25
26
27 23
28 command HGDiff call s:OpenHgDiff(expand('%')) 24 command HGDiff call s:OpenHgDiff(expand('%'))
29 command Commit call s:CommitWithFormat() 25 command Commit call s:CommitWithFormat()
30 26
31 map <C-k> :Commit<CR> 27 map <C-k> :Commit<CR>