diff options
| author | Peter Stephenson <p.w.stephenson@ntlworld.com> | 2015-03-22 18:44:56 +0000 |
|---|---|---|
| committer | Peter Stephenson <p.w.stephenson@ntlworld.com> | 2015-03-22 18:44:56 +0000 |
| commit | 4fb669a72deb547b6ec1c9298373e3b78384983d (patch) | |
| tree | 77aa39005413303b640a0c63d8e0c91f8e8e8001 /Src/lex.c | |
| parent | users/20034: adjust PREFIX and SUFFIX for unambiguous_cursor on second comple... (diff) | |
| download | zsh-4fb669a72deb547b6ec1c9298373e3b78384983d.tar zsh-4fb669a72deb547b6ec1c9298373e3b78384983d.tar.gz zsh-4fb669a72deb547b6ec1c9298373e3b78384983d.tar.bz2 zsh-4fb669a72deb547b6ec1c9298373e3b78384983d.tar.lz zsh-4fb669a72deb547b6ec1c9298373e3b78384983d.tar.xz zsh-4fb669a72deb547b6ec1c9298373e3b78384983d.tar.zst zsh-4fb669a72deb547b6ec1c9298373e3b78384983d.zip | |
34758: fix yet more history / command subst interaction.
In general we need to wind back over the history text input
inside command substitution because there's no level of
the input mechanism between history and the lexer.
Diffstat (limited to 'Src/lex.c')
| -rw-r--r-- | Src/lex.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -1871,6 +1871,25 @@ zshlex_raw_back(void) lexbuf_raw.len--; } +/**/ +char * +zshlex_raw_mark(int offset) +{ + if (!lex_add_raw) + return NULL; + return lexbuf_raw.ptr + offset; +} + +/**/ +void +zshlex_raw_back_to_mark(char *mark) +{ + if (!lex_add_raw) + return; + lexbuf_raw.len -= lexbuf_raw.ptr - mark; + lexbuf_raw.ptr = mark; +} + /* * Skip (...) for command-style substitutions: $(...), <(...), >(...) * |
