about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-05-03 23:49:30 -0700
committerKartik Agaram <vc@akkartik.com>2020-05-03 23:49:30 -0700
commitb2c8b7327b0bad37ea16c73c4b07fd13d801bf42 (patch)
tree9b373457da01614aa89735c50393b456806229eb
parent6c29edc726cd17880bd887dd2d69e8a9700583ac (diff)
downloadmu-b2c8b7327b0bad37ea16c73c4b07fd13d801bf42.tar.gz
6215 - show call stack in trace
-rw-r--r--vimrc.vim4
1 files changed, 4 insertions, 0 deletions
diff --git a/vimrc.vim b/vimrc.vim
index 45e61f2d..76641e63 100644
--- a/vimrc.vim
+++ b/vimrc.vim
@@ -65,6 +65,10 @@ endif
 " see https://github.com/akkartik/mu/blob/master/Readme.md#a-few-hints-for-debugging
 command! -nargs=0 L exec "%!grep label |grep -v clear-stream:loop"
 
+" show the call stack for the current line in the trace (by temporarily blowing away all earlier lines)
+"? command! -nargs=0 C 1,.!awk '$4 == "label"{x[$1] = $0; for(i in x){if(i >= $1){delete x[i]}}} END{for (i in x) {if (i < $1) {print x[i]}}}'
+command! -nargs=0 C 1,.!awk '{x[$1] = $0} END{for (i in x) {if (int(i) < int($1)) {print x[i]}}}'
+
 " run test around cursor
 if empty($TMUX)
   " hack: need to move cursor outside function at start (`{`), but inside function at end (`<C-o>`)