summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2011-08-18 02:24:10 +0000
committerBart Schaefer <barts@users.sourceforge.net>2011-08-18 02:24:10 +0000
commitf7111d33584a54aa28fca5660f25e8a9fecdfb0d (patch)
tree79582b892a3fdf683945a0772a417e9ed8d50079
parentUse preexec hook to replace "fg" et al. with the jobtext of the resumed job. (diff)
downloadzsh-f7111d33584a54aa28fca5660f25e8a9fecdfb0d.tar
zsh-f7111d33584a54aa28fca5660f25e8a9fecdfb0d.tar.gz
zsh-f7111d33584a54aa28fca5660f25e8a9fecdfb0d.tar.bz2
zsh-f7111d33584a54aa28fca5660f25e8a9fecdfb0d.tar.lz
zsh-f7111d33584a54aa28fca5660f25e8a9fecdfb0d.tar.xz
zsh-f7111d33584a54aa28fca5660f25e8a9fecdfb0d.tar.zst
zsh-f7111d33584a54aa28fca5660f25e8a9fecdfb0d.zip
29694: avoid overwriting current history word when not expanding an alias
or history event in-place.
-rw-r--r--Src/hist.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/hist.c b/Src/hist.c
index 636f46411..aeb6edda5 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -1355,7 +1355,8 @@ ihwend(void)
(chwordlen += 32) *
sizeof(short));
}
- if (hwgetword > -1) {
+ if (hwgetword > -1 &&
+ (inbufflags & INP_ALIAS) && !(inbufflags & INP_HIST)) {
/* We want to reuse the current word position */
chwordpos = hwgetword;
/* Start from where previous word ended, if possible */