|
0
|
1 " autoload/core.vim
|
|
|
2 " Functions are loaded on demand
|
|
1
|
3 if exists('g:loaded_core')
|
|
0
|
4 finish
|
|
|
5 endif
|
|
1
|
6 let g:loaded_core = 1
|
|
0
|
7
|
|
1
|
8 function! core#PopupCommand(command)
|
|
|
9 let buf = term_start(a:command, {'hidden': 1, 'term_finish': 'close'})
|
|
|
10 let winid = popup_create(buf, {'minwidth': 120, 'minheight': 28})
|
|
0
|
11 endfunction
|
|
1
|
12
|
|
|
13 function! core#ReadOnlyPopup(content)
|
|
|
14 let lines = split(a:content, "\n")
|
|
|
15 let winid = popup_create(lines, {'minwidth':120, 'minheight':28})
|
|
|
16 let buf = winbufnr(winid)
|
|
|
17 call setbufvar(buf, '&modifiable', 0)
|
|
|
18 call setbufvar(buf, '&bufhidden', 'wipe')
|
|
|
19 return winid
|
|
|
20 endfunction
|
|
|
21
|
|
|
22 function! core#ExecuteCommand(command)
|
|
|
23 " a:command is a shell command string, e.g. 'hg status'
|
|
|
24 return system(a:command . ' 2>&1')
|
|
|
25 endfunction
|