diff options
author | Emilio Jesus Gallego Arias <e+git@x80.org> | 2018-03-11 00:49:56 +0100 |
---|---|---|
committer | Emilio Jesus Gallego Arias <e+git@x80.org> | 2018-03-11 00:49:56 +0100 |
commit | efb37cb4dd0976acd2a87c6a27d1fb3e9e80ad30 (patch) | |
tree | 80161e54fa6fbf060413f079788926bad14edbe8 /stm | |
parent | 33c5d8d00cb017c61141ee0d6b7cb8f672a3e691 (diff) |
[stm] Never consider `Backtrack` as part of the script.
This makes Emacs's `Backtrack` commands to be similar to `EditAt`,
thus they will correctly revert the document state. This fixes #6240
and likely some other synchronization bugs.
It is still unfortunate that true meta commands are part of the
vernacular, we should fix this for 8.9.
Diffstat (limited to 'stm')
-rw-r--r-- | stm/stm.ml | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/stm/stm.ml b/stm/stm.ml index ad94b6807..dbecbdae5 100644 --- a/stm/stm.ml +++ b/stm/stm.ml @@ -2803,6 +2803,11 @@ let process_transaction ?(newtip=Stateid.fresh ()) ?(part_of_script=true) (* Meta *) | VtMeta, _ -> let id, w = Backtrack.undo_vernac_classifier expr in + (* Special case Backtrack, as it is never part of a script. See #6240 *) + let part_of_script = begin match Vernacprop.under_control expr with + | VernacBacktrack _ -> false + | _ -> part_of_script + end in process_back_meta_command ~part_of_script ~newtip ~head id x w (* Query *) | VtQuery (false,route), VtNow -> |