summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/uitext.ml8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/uitext.ml b/src/uitext.ml
index 53ae4c1..8ffdf95 100644
--- a/src/uitext.ml
+++ b/src/uitext.ml
@@ -321,14 +321,14 @@ let interact prilist rilist =
loop (nukeIgnoredRis (ri::prev)) (nukeIgnoredRis ril) in
(* This should work on most terminals: *)
let redisplayri() = overwrite (); displayri ri; display "\n" in
- let actOnMatching ?(change=true) f =
+ let actOnMatching ?(change=true) ?(discard=false) f =
(* [f] can have effects on the ri and return false to discard it *)
(* Disabling [change] avoids to redisplay the item, allows [f] to
print a message (info or error) on a separate line and repeats
instead of going to the next item *)
match !ripred with
| None -> if not change then newLine();
- if f ri
+ if f ri || not discard
then begin
if change then begin redisplayri(); next() end
else repeat()
@@ -337,7 +337,7 @@ let interact prilist rilist =
loop prev rest
end
| Some test -> newLine();
- let filt = fun ri -> if test ri then f ri else true in
+ let filt = fun ri -> if test ri then f ri || not discard else true in
loop prev (ri::Safelist.filter filt rest)
in
displayri ri;
@@ -519,7 +519,7 @@ let interact prilist rilist =
(["-"],
("skip and discard for this session (curr or match)"),
(fun () ->
- actOnMatching (fun _->false)));
+ actOnMatching ~discard:true (fun _->false)));
(["+"],
("skip and discard all the following"),
(fun () -> newLine();