From a007b9cde85ac12afcc6fab8b314ccfc946c42a5 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Mon, 28 Jul 2008 20:05:35 +0000 Subject: [PATCH] adjusted esc and control-g wrt snapback and search svn: r10947 --- collects/framework/private/frame.ss | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/collects/framework/private/frame.ss b/collects/framework/private/frame.ss index a4623d989f..847aed1719 100644 --- a/collects/framework/private/frame.ss +++ b/collects/framework/private/frame.ss @@ -1947,13 +1947,21 @@ (send search/replace-keymap add-function "hide-search" (λ (text evt) (let ([tlw (send text get-top-level-window)]) - (when (preferences:get 'framework:anchored-search) - (let ([text-to-search (send tlw get-text-to-search)]) - (when text-to-search - (let ([anchor-pos (send text-to-search get-anchor-pos)]) - (when anchor-pos - (send text-to-search set-position anchor-pos)))))) - (send tlw hide-search)))) + (when tlw + (send tlw hide-search))))) + +(send search/replace-keymap map-function "c:g" "hide-search-and-snap-back") +(send search/replace-keymap add-function "hide-search-and-snap-back" + (λ (text evt) + (let ([tlw (send text get-top-level-window)]) + (when tlw + (when (preferences:get 'framework:anchored-search) + (let ([text-to-search (send tlw get-text-to-search)]) + (when text-to-search + (let ([anchor-pos (send text-to-search get-anchor-pos)]) + (when anchor-pos + (send text-to-search set-position anchor-pos)))))) + (send tlw hide-search))))) (define searchable-canvas% (class editor-canvas%