diff autoload/core.vim @ 1:7c5bd18befd2 default tip

Some basic usage
author Luka Sitas <lsitas@avatarasoftware.com>
date Tue, 10 Mar 2026 21:31:17 -0400
parents 7bb5f650cfb7
children
line wrap: on
line diff
--- a/autoload/core.vim	Tue Mar 10 20:28:16 2026 -0400
+++ b/autoload/core.vim	Tue Mar 10 21:31:17 2026 -0400
@@ -1,10 +1,25 @@
 " autoload/core.vim
 " Functions are loaded on demand
-
-if exists('*core#greet')
+if exists('g:loaded_core')
   finish
 endif
+let g:loaded_core = 1
 
-function! core#greet() abort
-  echo g:core_greeting
+function! core#PopupCommand(command)
+	let buf = term_start(a:command, {'hidden': 1, 'term_finish': 'close'})
+	let winid = popup_create(buf, {'minwidth': 120, 'minheight': 28})
 endfunction
+
+function! core#ReadOnlyPopup(content)
+  let lines = split(a:content, "\n")
+  let winid = popup_create(lines, {'minwidth':120, 'minheight':28})
+  let buf = winbufnr(winid)
+  call setbufvar(buf, '&modifiable', 0)
+  call setbufvar(buf, '&bufhidden', 'wipe')
+  return winid
+endfunction
+
+function! core#ExecuteCommand(command)
+  " a:command is a shell command string, e.g. 'hg status'
+  return system(a:command . ' 2>&1')
+endfunction