vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit f55157d7d9b3040139ab417f065d6f2b22c8d429
parent 025238c84898e294dafef9a3919ad7f9d1614c94
Author: Marc André Tanner <mat@brain-dump.org>
Date: Thu, 6 Apr 2017 22:03:45 +0200
test: terminate tests via command line argument not lua code
Executing a vis:command("qall!") or similar from a Lua WIN_OPEN
event handler is a bad idea.
Diffstat:
| M | sam/test.sh | | | 2 | +- |
| M | sam/visrc.lua | | | 3 | +-- |
| M | vis/test.sh | | | 2 | +- |
| M | vis/visrc.lua | | | 1 | - |
4 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/sam/test.sh b/sam/test.sh @@ -73,7 +73,7 @@ for t in $TESTS; do TESTS_RUN=$((TESTS_RUN+1)) - $VIS "$IN" </dev/null 2>/dev/null + $VIS '+qall!' "$IN" </dev/null 2>/dev/null RETURN_CODE=$? printf "Running test %s with vis ... " "$t" diff --git a/sam/visrc.lua b/sam/visrc.lua @@ -9,7 +9,6 @@ vis.events.win_open = function(win) local cmd = cmd_file:read('*all') vis:command(string.format(",{\n %s\n }", cmd)) local out_file_name = string.gsub(in_file, '%.in$', '.vis.out') - vis:command(string.format("wq! %s", out_file_name)) + vis:command(string.format("w! %s", out_file_name)) end - vis:command('qall!') end diff --git a/vis/test.sh b/vis/test.sh @@ -25,7 +25,7 @@ for t in $test_files; do TESTS_RUN=$((TESTS_RUN + 1)) t=${t%.in} t=${t#./} - $VIS "$t".in < /dev/null 2> /dev/null + $VIS '+qall!' "$t".in < /dev/null 2> /dev/null RETURN_CODE=$? printf "%-50s" "$t" diff --git a/vis/visrc.lua b/vis/visrc.lua @@ -14,6 +14,5 @@ vis.events.subscribe(vis.events.WIN_OPEN, function(win) file:close() vis:feedkeys(keys..'<Escape>') vis:command(string.format("w! '%s.out'", name)) - vis:command('qall!') end end)