Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Alias fix
- X-seq: zsh-workers 612
- From: Peter William Stephenson <pws@xxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxxx (Zsh hackers list)
- Subject: Alias fix
- Date: Wed, 15 Nov 1995 16:32:17 +0100
I've wasted the whole day fixing bugs, there's no point doing
anything useful now:
This fixes this problem I've just reported:
% alias foo='echo '
% foo bar
bar
% <up-arrow> -> % foo bar
(extra spaces being inserted). The fix is deliberately restrictive so
as not to cause knock-on problems.
*** Src/hist.c.sp Wed Nov 15 14:29:01 1995
--- Src/hist.c Wed Nov 15 16:29:55 1995
***************
*** 686,691 ****
--- 686,701 ----
alstat = 0;
}
+ /* Go back to immediately after the last word, skipping space. */
+
+ /**/
+ void
+ histbackword(void)
+ {
+ if (!(chwordpos%2) && chwordpos)
+ hptr = chline + chwords[chwordpos-1];
+ }
+
/* Get the start and end point of the current history word */
/**/
*** Src/input.c.sp Wed Nov 15 16:14:35 1995
--- Src/input.c Wed Nov 15 16:22:30 1995
***************
*** 161,169 ****
/* a real alias: mark it as unused. */
ix->inuse = 0;
t = ix->text;
! if (*t && t[strlen(t) - 1] == ' ')
alstat = ALSTAT_MORE;
! else
alstat = ALSTAT_JUNK;
inalpush(ix);
}
--- 161,170 ----
/* a real alias: mark it as unused. */
ix->inuse = 0;
t = ix->text;
! if (*t && t[strlen(t) - 1] == ' ') {
alstat = ALSTAT_MORE;
! histbackword();
! } else
alstat = ALSTAT_JUNK;
inalpush(ix);
}
--
Peter Stephenson <pws@xxxxxx> Tel: +49 33762 77366
WWW: http://www.ifh.de/~pws/ Fax: +49 33762 77330
Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author