Skip to content

Commit f640c2c

Browse files
rfindlerrmculpepper
authored andcommitted
only when when there is something to undo
They hypothesis behind this change is that the undo is undoing an edit that came before, not the temporary edit that appears in insert-close-paren. So, when there are no edits happening (ie when fixup? is #f) then don't undo. This is only a hypothesis because we were not able to find a small code sequence, outside of DrRacket to cause the bad behavior, so possibly there is really more going on here. Thanks to Nadeem Abdul Hamid for finding this fix. Closes PR 13454 (cherry picked from commit f90eb33)
1 parent a0ac38d commit f640c2c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

collects/framework/private/color.rkt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ added get-regions
10751075
(cond
10761076
[(eq? smart-skip 'adjacent)
10771077
(end-edit-sequence) ;; wraps up the net-zero editing changes done by get-close-paren etc.
1078-
(undo) ;; to avoid messing up the editor's modified state in case of a simple skip
1078+
(when fixup? (undo)) ;; to avoid messing up the editor's modified state in case of a simple skip
10791079
(if (and next-close-start next-close-adj?
10801080
(string=? insert-str next-close-str))
10811081
(skip next-close-end)

0 commit comments

Comments
 (0)