about summary refs log tree commit diff stats
path: root/vimrc.vim
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2019-09-08 00:17:34 -0700
committerKartik Agaram <vc@akkartik.com>2019-09-08 00:17:34 -0700
commit4c131b38139eb989a25c7125502295ae1de2a1ea (patch)
tree792826749dccdadfcf71d575a5503e5108897986 /vimrc.vim
parentac4839899a1336ed4fa3407b6e0c908148fe5d4a (diff)
downloadmu-4c131b38139eb989a25c7125502295ae1de2a1ea.tar.gz
5643
Diffstat (limited to 'vimrc.vim')
-rw-r--r--vimrc.vim14
1 files changed, 5 insertions, 9 deletions
diff --git a/vimrc.vim b/vimrc.vim
index 4cb926d0..ed3e1843 100644
--- a/vimrc.vim
+++ b/vimrc.vim
@@ -74,7 +74,7 @@ endif
 " the '-a' is because traces can sometimes contain unprintable characters that bother grep
 command! -nargs=0 L exec "%!grep -a label |grep -v clear-stream:loop"
 
-" run test cursor around cursor
+" run test around cursor
 " Unfortunately this only works with Linux at the moment.
 " Some compiler passes take too long to run in emulated mode.
 if empty($TMUX)
@@ -83,21 +83,17 @@ if empty($TMUX)
   "   can't put initial cursor movement inside function because we rely on <C-r><C-w> to grab word at cursor
   "   can't put final cursor movement out of function because that disables the wait for <CR> prompt; function must be final operation of map
   "   can't avoid the function because that disables the wait for <CR> prompt
-  " known issue:
-  "   can't handle comments at start of current test
-  noremap <Leader>t {j0:call RunTestMoveCursor("<C-r><C-w>")<CR>
+  noremap <Leader>t {j0:keeppatterns /[^ #]<CR>:call RunTestMoveCursor("<C-r><C-w>")<CR>
   function RunTestMoveCursor(arg)
-    let l:arg = a:arg == "#" ? " " : a:arg  " Vim's '!' insists on interpreting '#' anywhere in its arg
-    exec "!./run_one_test ".expand("%")." ".l:arg
+    exec "!./run_one_test ".expand("%")." ".a:arg
     exec "normal \<C-o>"
   endfunction
 else
   " we have tmux; we don't need to show any output in the Vim pane so life is simpler
   " assume the left-most window is for the shell
-  noremap <Leader>t {j0:silent! call RunTestInFirstPane("<C-r><C-w>")<CR><C-o>
+  noremap <Leader>t {j0:keeppatterns /[^ #]<CR>:silent! call RunTestInFirstPane("<C-r><C-w>")<CR><C-o>
   function RunTestInFirstPane(arg)
-    let l:arg = a:arg == "#" ? " " : a:arg  " Vim's '!' insists on interpreting '#' anywhere in its arg
-    call RunInFirstPane("./run_one_test ".expand("%")." ".l:arg)
+    call RunInFirstPane("./run_one_test ".expand("%")." ".a:arg)
   endfunction
   function RunInFirstPane(arg)
     exec "!tmux select-pane -t :0.0"
href='/gbmor/clinte/commit/src/db.rs?h=v0.4.1&id=5b59ba3aee3e874b2e67cf529680d19910a3ec7d'>5b59ba3 ^
9ee17f1 ^
99273b6 ^
9ee17f1 ^







05649a5 ^
9ee17f1 ^







5b59ba3 ^




9ee17f1 ^


05649a5 ^

9ee17f1 ^



99273b6 ^
9ee17f1 ^
99273b6 ^

9ee17f1 ^






5b59ba3 ^
05649a5 ^
5b59ba3 ^









9ee17f1 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88