diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2019-03-10 21:22:06 +0100 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2019-03-10 21:22:06 +0100 |
commit | 9d9ed144857b686059f3daea7b2b953e382147c1 (patch) | |
tree | 193884e95d1727172020968e0e5ece1593275762 /autoload | |
parent | 5005f1e27a9a600822a16363eff5ee76bc130331 (diff) | |
download | vim-polyglot-9d9ed144857b686059f3daea7b2b953e382147c1.tar.gz vim-polyglot-9d9ed144857b686059f3daea7b2b953e382147c1.zip |
Add ACPI ASL and SMT2 support
closes #379
closes #378
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/smt2.vim | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/autoload/smt2.vim b/autoload/smt2.vim new file mode 100644 index 00000000..fd87febe --- /dev/null +++ b/autoload/smt2.vim @@ -0,0 +1,34 @@ +if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'smt2') != -1 + finish +endif + +" Invokes the solver on current file +function! smt2#RunSolver() + silent !clear + execute "!" . g:smt2_solver_command . " " . bufname("%") +endfunction + +" Puts the solver's output in new split (replaces old split) +function! smt2#RunSolverAndShowResult() + let output = system(g:smt2_solver_command . " " . bufname("%") . " 2>&1") + + " Create split (or reuse existent) + if exists("s:outputbufnr") && bufwinnr(s:outputbufnr) > 0 + execute bufwinnr(s:outputbufnr) . 'wincmd w' + else + silent! vnew + let s:outputbufnr=bufnr('%') + endif + + " Clear & (re-)fill contents + silent! normal! ggdG + setlocal filetype=smt2 buftype=nofile nobuflisted noswapfile + call append(0, split(output, '\v\n')) + normal! gg +endfunction + +" Requests the solver's version +function! smt2#PrintSolverVersion() + silent !clear + execute "!" . g:smt2_solver_command . " " . g:smt2_solver_version_switch +endfunction |