about summary refs log tree commit diff
path: root/Test
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2018-04-04 18:33:00 +0100
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2018-04-04 18:33:00 +0100
commit3517e4a9a5caf2c3385a0b223a0474724c703d96 (patch)
treed75e40e0bdcbd9baa10b858703a1c8ea47ed2385 /Test
parent1bd2ecc17d74b6a8ffba97806cf90ef706d7411b (diff)
downloadzsh-3517e4a9a5caf2c3385a0b223a0474724c703d96.tar.gz
zsh-3517e4a9a5caf2c3385a0b223a0474724c703d96.tar.xz
zsh-3517e4a9a5caf2c3385a0b223a0474724c703d96.zip
42581(?): Fix ZLE inline history expansion.
Seen with magic-space.

If there's a parse error in command subtitution we need to complete
reading history to ensure the command line buffer is finished.
Diffstat (limited to 'Test')
-rw-r--r--Test/X03zlebindkey.ztst17
1 files changed, 17 insertions, 0 deletions
diff --git a/Test/X03zlebindkey.ztst b/Test/X03zlebindkey.ztst
index 013d3dfb3..298d7df5d 100644
--- a/Test/X03zlebindkey.ztst
+++ b/Test/X03zlebindkey.ztst
@@ -126,3 +126,20 @@
 >CURSOR: 1
 >BUFFER: ホ
 >CURSOR: 1
+
+  zpty_run 'bindkey " " magic-space'
+  setopt interactivecomments
+  zletest 'echo $(( x ) x ) y'
+  zletest 'echo $(( ##x ) ##x ) y'
+  unsetopt interactivecomments
+  zletest 'echo $(( x ) x ) y'
+  zletest 'echo $(( ##x ) ##x ) y'
+0:history expansion of failed command substitution using magic-space binding
+>BUFFER: echo $(( x ) x ) y
+>CURSOR: 18
+>BUFFER: echo $(( ##x ) ##x ) y
+>CURSOR: 22
+>BUFFER: echo $(( x ) x ) y
+>CURSOR: 18
+>BUFFER: echo $(( ##x ) ##x ) y
+>CURSOR: 22