Mercurial > vim
diff plugins/hghelp/hghelp.vim @ 8:9c80955f0c6e
I think I got popups working on the commit
| author | Luka Sitas <lsitas@avatarasoftware.com> |
|---|---|
| date | Fri, 31 Oct 2025 14:24:31 -0400 |
| parents | 34930197e9d4 |
| children | 17c557de03e0 |
line wrap: on
line diff
--- a/plugins/hghelp/hghelp.vim Thu Oct 30 13:45:31 2025 -0400 +++ b/plugins/hghelp/hghelp.vim Fri Oct 31 14:24:31 2025 -0400 @@ -1,12 +1,23 @@ let g:hg_format_command = "" +function PopupCommand(command) + let buf = term_start(a:command, {'hidden': 1, 'term_finish': 'close'}) + let winid = popup_create(buf, {'minwidth': 50, 'minheight': 20}) +endfunction + +function ExecuteCommand(command) + return system(a:command . ' 2>&1') +endfunction + function! s:CommitWithFormat() wa if exists("g:hg_format_command") && !empty(g:hg_format_command) execute '!'.g:hg_format_command endif - execute '!hg addremove && hg commit' + execute + call ExecuteCommand('!hg addremove') + call PopupCommand('hg commit') endfunction function! s:OpenHgDiff(file) @@ -14,7 +25,7 @@ let l:filetype = &filetype let l:temp_file = tempname() let l:command = 'hg cat -r . ' . l:current_file . ' > ' . l:temp_file - let result = system(l:command . ' 2>&1') + call ExecuteCommand(l:command) execute 'tabe ' . l:temp_file execute 'setfiletype' l:filetype setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile
