summaryrefslogtreecommitdiff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/zle_hist.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/Src/Zle/zle_hist.c b/Src/Zle/zle_hist.c
index 0fdad70d9..53c722621 100644
--- a/Src/Zle/zle_hist.c
+++ b/Src/Zle/zle_hist.c
@@ -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;