mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-05-21 12:01:54 +02: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>
|
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
|
* 53244: Test/Y01completion.ztst: rename user in test case to
|
||||||
reduce likelihood of failure due to user existing
|
reduce likelihood of failure due to user existing
|
||||||
|
|
||||||
|
|
|
@ -1758,7 +1758,8 @@ acceptandinfernexthistory(char **args)
|
||||||
{
|
{
|
||||||
Histent he;
|
Histent he;
|
||||||
|
|
||||||
if (!(he = infernexthist(hist_ring, args)))
|
if (virangeflag || !(zlereadflags & ZLRF_HISTORY) ||
|
||||||
|
!(he = infernexthist(hist_ring, args)))
|
||||||
return 1;
|
return 1;
|
||||||
zpushnode(bufstack, ztrdup(he->node.nam));
|
zpushnode(bufstack, ztrdup(he->node.nam));
|
||||||
done = 1;
|
done = 1;
|
||||||
|
@ -1770,8 +1771,11 @@ acceptandinfernexthistory(char **args)
|
||||||
int
|
int
|
||||||
infernexthistory(char **args)
|
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)))
|
if (!he || !(he = infernexthist(he, args)))
|
||||||
return 1;
|
return 1;
|
||||||
zle_setline(he);
|
zle_setline(he);
|
||||||
|
@ -1784,12 +1788,14 @@ vifetchhistory(UNUSED(char **args))
|
||||||
{
|
{
|
||||||
if (zmult < 0)
|
if (zmult < 0)
|
||||||
return 1;
|
return 1;
|
||||||
if (histline == curhist) {
|
if (histline == curhist || virangeflag || !(zlereadflags & ZLRF_HISTORY)) {
|
||||||
if (!(zmod.flags & MOD_MULT)) {
|
if (!(zmod.flags & MOD_MULT)) {
|
||||||
zlecs = zlell;
|
zlecs = zlell;
|
||||||
zlecs = findbol();
|
zlecs = findbol();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
if (virangeflag || !(zlereadflags & ZLRF_HISTORY))
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
if (!zle_goto_hist((zmod.flags & MOD_MULT) ? zmult : curhist, 0, 0) &&
|
if (!zle_goto_hist((zmod.flags & MOD_MULT) ? zmult : curhist, 0, 0) &&
|
||||||
isset(HISTBEEP)) {
|
isset(HISTBEEP)) {
|
||||||
|
@ -1933,6 +1939,9 @@ getvisrchstr(void)
|
||||||
int
|
int
|
||||||
vihistorysearchforward(char **args)
|
vihistorysearchforward(char **args)
|
||||||
{
|
{
|
||||||
|
if (virangeflag || !(zlereadflags & ZLRF_HISTORY))
|
||||||
|
return 1;
|
||||||
|
|
||||||
if (*args) {
|
if (*args) {
|
||||||
int ose = visrchsense, ret;
|
int ose = visrchsense, ret;
|
||||||
char *ost = visrchstr;
|
char *ost = visrchstr;
|
||||||
|
@ -1954,6 +1963,9 @@ vihistorysearchforward(char **args)
|
||||||
int
|
int
|
||||||
vihistorysearchbackward(char **args)
|
vihistorysearchbackward(char **args)
|
||||||
{
|
{
|
||||||
|
if (virangeflag || !(zlereadflags & ZLRF_HISTORY))
|
||||||
|
return 1;
|
||||||
|
|
||||||
if (*args) {
|
if (*args) {
|
||||||
int ose = visrchsense, ret;
|
int ose = visrchsense, ret;
|
||||||
char *ost = visrchstr;
|
char *ost = visrchstr;
|
||||||
|
@ -1979,8 +1991,9 @@ virepeatsearch(UNUSED(char **args))
|
||||||
int n = zmult;
|
int n = zmult;
|
||||||
char *zt;
|
char *zt;
|
||||||
|
|
||||||
if (!visrchstr)
|
if (!visrchstr || virangeflag || !(zlereadflags & ZLRF_HISTORY))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (zmult < 0) {
|
if (zmult < 0) {
|
||||||
n = -n;
|
n = -n;
|
||||||
visrchsense = -visrchsense;
|
visrchsense = -visrchsense;
|
||||||
|
|
Loading…
Reference in a new issue