From abf83c1c3747a4e728b210c15556c1efa41f5bbf Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Thu, 1 Jun 2006 22:59:14 +0000 Subject: [PATCH] tweak to avoid re-complete when typing a character from the completed text svn: r3174 --- collects/mred/private/path-dialog.ss | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/collects/mred/private/path-dialog.ss b/collects/mred/private/path-dialog.ss index 0c9a675d9e..e444a5397f 100644 --- a/collects/mred/private/path-dialog.ss +++ b/collects/mred/private/path-dialog.ss @@ -441,14 +441,18 @@ ;; a b c d| => typed a character from completed text (and last-text-completed? (= len start end) - (< last-text-start len last-text-end) + (<= last-text-start len last-text-end) (prefix? value last-text-value #t)) - (send completion-timer stop) - ;; => shrink the completed part - (send text set-value last-text-value) - (set! change? #f) - (send text* set-position start last-text-end #f #f 'local) - (set! last-text-start start)] + ;; in some situations this is called with the same text before + ;; the new character is inserted -- do nothing in that case, + ;; not even set-ok? + (when (< last-text-start len last-text-end) + (send completion-timer stop) + ;; => shrink the completed part + (send text set-value last-text-value) + (send text* set-position start last-text-end #f #f 'local) + (set! last-text-start start)) + (set! change? #f)] [;; a b c d ;; a b c => removed text (prefix? value last-text-value #t)