aboutsummaryrefslogtreecommitdiff
path: root/lib/edit.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/edit.ml')
-rw-r--r--lib/edit.ml4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/edit.ml b/lib/edit.ml
index a7a7520b83..e22c17ad51 100644
--- a/lib/edit.ml
+++ b/lib/edit.ml
@@ -80,8 +80,8 @@ let undo e n =
| None -> invalid_arg "Edit.undo"
| Some d ->
let (bs,_) = Hashtbl.find e.buf d in
- if Bstack.depth bs <= n then
- errorlabstrm "Edit.undo" (str"Undo stack exhausted");
+ if Bstack.depth bs = 1 & n > 0 then
+ errorlabstrm "Edit.undo" (str"Undo stack exhausted");
repeat n Bstack.pop bs
let create e (d,b,c,udepth) =