comparison plugins/hghelp/hghelp.vim @ 17:412c33afd395

Update for core and some minor fixes
author Luka Sitas <lsitas@avatarasoftware.com>
date Fri, 05 Dec 2025 08:48:49 -0500
parents 7edd5f6fe136
children 203279635445
comparison
equal deleted inserted replaced
16:d30762aa23dd 17:412c33afd395
1 let g:hg_format_command = "" 1 let g:hg_format_command = ""
2 2
3
4 function PopupCommand(command)
5 let buf = term_start(a:command, {'hidden': 1, 'term_finish': 'close'})
6 let winid = popup_create(buf, {'minwidth': 120, 'minheight': 28})
7 endfunction
8
9 function! ExecuteCommand(command)
10 " a:command is a shell command string, e.g. 'hg status'
11 return system(a:command . ' 2>&1')
12 endfunction
13 3
14 function! s:CommitWithFormat() 4 function! s:CommitWithFormat()
15 wa 5 wa
16 if exists("g:hg_format_command") && !empty(g:hg_format_command) 6 if exists("g:hg_format_command") && !empty(g:hg_format_command)
17 execute '!'.g:hg_format_command 7 execute '!'.g:hg_format_command
18 endif 8 endif
19 execute 9 execute
20 call ExecuteCommand('!hg addremove') 10 call ExecuteCommand('!hg addremove')
21 call PopupCommand('hg commit') 11 call PopupCommand('hg commit')
22 endfunction 12 endfunction
13
23 14
24 function! s:OpenHgDiff(file) 15 function! s:OpenHgDiff(file)
25 let l:current_file = a:file !=# '' ? a:file : expand('%') 16 let l:current_file = a:file !=# '' ? a:file : expand('%')
26 let l:filetype = &filetype 17 let l:filetype = &filetype
27 let l:temp_file = tempname() 18 let l:temp_file = tempname()