From f90eb33d67a7e054b717f7a827ca17013499eb19 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Sat, 26 Jan 2013 07:43:32 -0600 Subject: [PATCH] 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 --- collects/framework/private/color.rkt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collects/framework/private/color.rkt b/collects/framework/private/color.rkt index 17e83a9b60..8dbebae83c 100644 --- a/collects/framework/private/color.rkt +++ b/collects/framework/private/color.rkt @@ -1075,7 +1075,7 @@ added get-regions (cond [(eq? smart-skip 'adjacent) (end-edit-sequence) ;; wraps up the net-zero editing changes done by get-close-paren etc. - (undo) ;; to avoid messing up the editor's modified state in case of a simple skip + (when fixup? (undo)) ;; to avoid messing up the editor's modified state in case of a simple skip (if (and next-close-start next-close-adj? (string=? insert-str next-close-str)) (skip next-close-end)