diff options
author | G.raud <graud@gmx.com> | 2018-02-03 13:53:04 +0100 |
---|---|---|
committer | G.raud <graud@gmx.com> | 2018-02-03 18:24:26 +0100 |
commit | 3f87f03aad9ee31d607b3e9fc6df2d2facbe0b1d (patch) | |
tree | 1c9054c61c6c5e5ca770f1bccff896bd9bd557a9 | |
parent | 7340d709618f0f9d65c4a544dc376ad5dc34349f (diff) | |
download | unison-3f87f03aad9ee31d607b3e9fc6df2d2facbe0b1d.zip unison-3f87f03aad9ee31d607b3e9fc6df2d2facbe0b1d.tar.gz unison-3f87f03aad9ee31d607b3e9fc6df2d2facbe0b1d.tar.bz2 |
Uitext.interact: in actOnMatching let returned bool decide whether to go next
-rw-r--r-- | src/uitext.ml | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/uitext.ml b/src/uitext.ml index 8ffdf95..1220b13 100644 --- a/src/uitext.ml +++ b/src/uitext.ml @@ -326,12 +326,15 @@ let interact prilist rilist = (* 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 *) + (* When [discard] is true if [f] returns false then instead of + repeating we discard the item (and go to the next) *) match !ripred with | None -> if not change then newLine(); - if f ri || not discard + let t = f ri in + if t || not discard then begin - if change then begin redisplayri(); next() end - else repeat() + if change then redisplayri(); + if t && change then next() else repeat() end else begin if change then newLine(); loop prev rest |