diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-02-11 15:18:42 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-02-11 15:18:42 +0100 |
| commit | 9854085fee254ef0c96775031089911cf72164c2 (patch) | |
| tree | 8e004c9abea572af38f80c6da6b4aa25586b3fcb | |
| parent | ec726488105714ac6c55d910e2116785cc479e5b (diff) | |
| download | vis-9854085fee254ef0c96775031089911cf72164c2.tar.gz vis-9854085fee254ef0c96775031089911cf72164c2.tar.xz | |
test/vis: drop cpp(1) as a preprocessor
It is not worth the trouble to deal with different escaping rules.
The tests should be relatively small and self contained anyway,
hence comments should not be that important.
| -rw-r--r-- | vis/multiple-cursors/basic.keys | 6 | ||||
| -rw-r--r-- | vis/multiple-cursors/new-start-of-line.in (renamed from vis/multiple-cursors/basic.in) | 0 | ||||
| -rw-r--r-- | vis/multiple-cursors/new-start-of-line.keys | 6 | ||||
| -rw-r--r-- | vis/multiple-cursors/new-start-of-line.ref (renamed from vis/multiple-cursors/basic.ref) | 0 | ||||
| -rw-r--r-- | vis/multiple-cursors/normal-mode-wq.in | 12 | ||||
| -rw-r--r-- | vis/multiple-cursors/normal-mode-wq.keys | 8 | ||||
| -rw-r--r-- | vis/multiple-cursors/normal-mode-wq.ref | 12 | ||||
| -rw-r--r-- | vis/prompt/history.keys | 12 | ||||
| -rw-r--r-- | vis/visrc.lua | 2 |
9 files changed, 33 insertions, 25 deletions
diff --git a/vis/multiple-cursors/basic.keys b/vis/multiple-cursors/basic.keys deleted file mode 100644 index df8738e..0000000 --- a/vis/multiple-cursors/basic.keys +++ /dev/null @@ -1,6 +0,0 @@ -vGI /* create cursor at start of every line */ -df<Space> /* delete to first space */ -. /* delete to second space */ -A : end<Escape> /* append " : end" to line */ -. /* repeat */ -u /* undo */ diff --git a/vis/multiple-cursors/basic.in b/vis/multiple-cursors/new-start-of-line.in index 949ea37..949ea37 100644 --- a/vis/multiple-cursors/basic.in +++ b/vis/multiple-cursors/new-start-of-line.in diff --git a/vis/multiple-cursors/new-start-of-line.keys b/vis/multiple-cursors/new-start-of-line.keys new file mode 100644 index 0000000..0290010 --- /dev/null +++ b/vis/multiple-cursors/new-start-of-line.keys @@ -0,0 +1,6 @@ +vGI +df<Space> +. +A : end<Escape> +. +u diff --git a/vis/multiple-cursors/basic.ref b/vis/multiple-cursors/new-start-of-line.ref index 7c5bd13..7c5bd13 100644 --- a/vis/multiple-cursors/basic.ref +++ b/vis/multiple-cursors/new-start-of-line.ref diff --git a/vis/multiple-cursors/normal-mode-wq.in b/vis/multiple-cursors/normal-mode-wq.in index b2a41f8..3f723c4 100644 --- a/vis/multiple-cursors/normal-mode-wq.in +++ b/vis/multiple-cursors/normal-mode-wq.in @@ -1,4 +1,8 @@ -1: first -2: second -3: third -4: fourth +make +sure +:wq +works +when +multiple +cursors +exist diff --git a/vis/multiple-cursors/normal-mode-wq.keys b/vis/multiple-cursors/normal-mode-wq.keys index f8974a8..12c1412 100644 --- a/vis/multiple-cursors/normal-mode-wq.keys +++ b/vis/multiple-cursors/normal-mode-wq.keys @@ -1,4 +1,4 @@ -vGI /* create cursor at start of every line */ -<C-k> /* move primary cursor up */ -<C-p> /* remove primary cursor */ -i /* switch to insert mode, so that <Esc> after test leaves cursors active */ +vGI +<C-k> +<C-p> +i diff --git a/vis/multiple-cursors/normal-mode-wq.ref b/vis/multiple-cursors/normal-mode-wq.ref index b2a41f8..3f723c4 100644 --- a/vis/multiple-cursors/normal-mode-wq.ref +++ b/vis/multiple-cursors/normal-mode-wq.ref @@ -1,4 +1,8 @@ -1: first -2: second -3: third -4: fourth +make +sure +:wq +works +when +multiple +cursors +exist diff --git a/vis/prompt/history.keys b/vis/prompt/history.keys index 4faa765..ee7b037 100644 --- a/vis/prompt/history.keys +++ b/vis/prompt/history.keys @@ -1,6 +1,6 @@ -:-0+0x/line/c/word/<Enter> /* replace something on first line */ -:2<Enter>l /* select second line */ -:<Up><Up><Enter> /* repeat replacement */ -:e<Backspace><Backspace> /* simulate a typo on the command line */ -:3<Enter>l /* select third line */ -:<Up><Up><Enter> /* repeat replacement */ +:-0+0x/line/c/word/<Enter> +:2<Enter>l +:<Up><Up><Enter> +:e<Backspace><Backspace> +:3<Enter>l +:<Up><Up><Enter> diff --git a/vis/visrc.lua b/vis/visrc.lua index e19efed..642af45 100644 --- a/vis/visrc.lua +++ b/vis/visrc.lua @@ -5,7 +5,7 @@ vis.events.win_open = function(win) if name then -- use the corresponding test.lua file name = string.gsub(name, '%.in$', '') - local file = assert(io.popen(string.format("cpp -P '%s.keys'", name), 'r')) + local file = io.open(string.format("%s.keys", name)) local keys = file:read('*all') keys = string.gsub(keys, '%s*\n', '') keys = string.gsub(keys, '<Space>', ' ') |
