mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-12-27 15:55:06 +01:00
53243: fix use of vi-fetch-history with a range
This commit is contained in:
parent
638e09af6e
commit
3c0f932300
2 changed files with 20 additions and 4 deletions
|
@ -1,5 +1,8 @@
|
|||
2024-11-23 Oliver Kiddle <opk@zsh.org>
|
||||
|
||||
* 53243: Src/Zle/zle_hist.c: fix use of vi-fetch-history
|
||||
with a range
|
||||
|
||||
* 53244: Test/Y01completion.ztst: rename user in test case to
|
||||
reduce likelihood of failure due to user existing
|
||||
|
||||
|
|
|
@ -1758,7 +1758,8 @@ acceptandinfernexthistory(char **args)
|
|||
{
|
||||
Histent he;
|
||||
|
||||
if (!(he = infernexthist(hist_ring, args)))
|
||||
if (virangeflag || !(zlereadflags & ZLRF_HISTORY) ||
|
||||
!(he = infernexthist(hist_ring, args)))
|
||||
return 1;
|
||||
zpushnode(bufstack, ztrdup(he->node.nam));
|
||||
done = 1;
|
||||
|
@ -1770,8 +1771,11 @@ acceptandinfernexthistory(char **args)
|
|||
int
|
||||
infernexthistory(char **args)
|
||||
{
|
||||
Histent he = quietgethist(histline);
|
||||
Histent he;
|
||||
if (virangeflag || !(zlereadflags & ZLRF_HISTORY))
|
||||
return 1;
|
||||
|
||||
he = quietgethist(histline);
|
||||
if (!he || !(he = infernexthist(he, args)))
|
||||
return 1;
|
||||
zle_setline(he);
|
||||
|
@ -1784,12 +1788,14 @@ vifetchhistory(UNUSED(char **args))
|
|||
{
|
||||
if (zmult < 0)
|
||||
return 1;
|
||||
if (histline == curhist) {
|
||||
if (histline == curhist || virangeflag || !(zlereadflags & ZLRF_HISTORY)) {
|
||||
if (!(zmod.flags & MOD_MULT)) {
|
||||
zlecs = zlell;
|
||||
zlecs = findbol();
|
||||
return 0;
|
||||
}
|
||||
if (virangeflag || !(zlereadflags & ZLRF_HISTORY))
|
||||
return 1;
|
||||
}
|
||||
if (!zle_goto_hist((zmod.flags & MOD_MULT) ? zmult : curhist, 0, 0) &&
|
||||
isset(HISTBEEP)) {
|
||||
|
@ -1933,6 +1939,9 @@ getvisrchstr(void)
|
|||
int
|
||||
vihistorysearchforward(char **args)
|
||||
{
|
||||
if (virangeflag || !(zlereadflags & ZLRF_HISTORY))
|
||||
return 1;
|
||||
|
||||
if (*args) {
|
||||
int ose = visrchsense, ret;
|
||||
char *ost = visrchstr;
|
||||
|
@ -1954,6 +1963,9 @@ vihistorysearchforward(char **args)
|
|||
int
|
||||
vihistorysearchbackward(char **args)
|
||||
{
|
||||
if (virangeflag || !(zlereadflags & ZLRF_HISTORY))
|
||||
return 1;
|
||||
|
||||
if (*args) {
|
||||
int ose = visrchsense, ret;
|
||||
char *ost = visrchstr;
|
||||
|
@ -1979,8 +1991,9 @@ virepeatsearch(UNUSED(char **args))
|
|||
int n = zmult;
|
||||
char *zt;
|
||||
|
||||
if (!visrchstr)
|
||||
if (!visrchstr || virangeflag || !(zlereadflags & ZLRF_HISTORY))
|
||||
return 1;
|
||||
|
||||
if (zmult < 0) {
|
||||
n = -n;
|
||||
visrchsense = -visrchsense;
|
||||
|
|
Loading…
Reference in a new issue