aboutsummaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorJosh Wainwright <josh.wainwright@ldra.com>2016-04-21 09:05:38 +0100
committerJosh Wainwright <josh.wainwright@ldra.com>2016-04-21 09:05:38 +0100
commit230b3c1485318e3a028a53082627a128ddaa2754 (patch)
treeb0d36636c1bcb635ae9cf571542f2c77afa45f18 /lua
parent2b18735726cd92be87e20f30680d85e7f0f1a3b2 (diff)
downloadvis-230b3c1485318e3a028a53082627a128ddaa2754.tar.gz
vis-230b3c1485318e3a028a53082627a128ddaa2754.tar.xz
Quit vis from within test visrc.lua
Diffstat (limited to 'lua')
-rw-r--r--lua/test.sh3
-rw-r--r--lua/visrc.lua9
2 files changed, 4 insertions, 8 deletions
diff --git a/lua/test.sh b/lua/test.sh
index 852f035..dc77b64 100644
--- a/lua/test.sh
+++ b/lua/test.sh
@@ -16,8 +16,7 @@ for t in $test_files; do
TESTS_RUN=$((TESTS_RUN + 1))
t=${t%.in}
t=${t#./}
-# vis $t.in
- printf "<Escape>Q:q<Enter>" | ../util/keys | vis $t.in
+ $VIS $t.in
printf "%-30s" "$t"
if [ -e $t.out ]; then
diff --git a/lua/visrc.lua b/lua/visrc.lua
index dcd4d8e..2c8ff78 100644
--- a/lua/visrc.lua
+++ b/lua/visrc.lua
@@ -2,13 +2,10 @@ require("utils")
vis.events = {}
vis.events.win_open = function(win)
+ -- test.in file passed to vis
in_file = win.file.name
+ -- use the corresponding test.lua file
lua_file = string.gsub(in_file, '%.in$', '')
require(lua_file)
--- These both seem to cause crashes at the moment.
--- vis:command('q!')
---
--- vis:map(vis.MODE_NORMAL, "Q", function()
--- vis:command('q!')
--- end)
+ vis:command('q!')
end