about summary refs log tree commit diff stats
path: root/subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2019-07-19 10:30:23 -0700
committerKartik Agaram <vc@akkartik.com>2019-07-19 10:30:23 -0700
commitcfb4b738c60ea7126f831248e665e15fea780216 (patch)
tree26fd2a7a46ea133af9113401dc99732a2625e3ab /subx
parent3943b27a003f31e5d3779e60609361db642478ad (diff)
downloadmu-cfb4b738c60ea7126f831248e665e15fea780216.tar.gz
5418 - vim tweaks
When running a single test, stop always opening the trace. Instead create
a separate affordance for that, and also have it reuse windows.
Diffstat (limited to 'subx')
-rw-r--r--subx/vimrc.vim13
1 files changed, 12 insertions, 1 deletions
diff --git a/subx/vimrc.vim b/subx/vimrc.vim
index 57c450d6..80ec5a5f 100644
--- a/subx/vimrc.vim
+++ b/subx/vimrc.vim
@@ -85,7 +85,11 @@ command! -nargs=0 L exec "%!grep -a label |grep -v clear-stream:loop"
 "   can't avoid the function because that disables the wait for <CR> prompt
 " known issue:
 "   cursor on '#' causes error
-noremap <Leader>t {j0:call RunTestMoveCursorAndMaybeOpenTrace("<C-r><C-w>")<CR>
+noremap <Leader>t {j0:call RunTestMoveCursor("<C-r><C-w>")<CR>
+function RunTestMoveCursor(arg)
+  exec "!run_one_test.sh ".expand("%")." ".a:arg
+  exec "normal \<C-o>"
+endfunction
 function RunTestMoveCursorAndMaybeOpenTrace(arg)
   exec "!run_one_test.sh ".expand("%")." ".a:arg
   exec "normal \<C-o>"
@@ -93,3 +97,10 @@ function RunTestMoveCursorAndMaybeOpenTrace(arg)
     noautocmd vertical split last_run
   endif
 endfunction
+
+set switchbuf=useopen
+if exists("&splitvertical")
+  command! -nargs=0 T badd last_run | sbuffer last_run
+else
+  command! -nargs=0 T badd last_run | vert sbuffer last_run
+endif