From 2d59128e5984963aed15fa58934976894e150db0 Mon Sep 17 00:00:00 2001 From: Ryan Culpepper Date: Tue, 30 Oct 2007 22:02:17 +0000 Subject: [PATCH] Macro stepper: navigation preserves visible line range svn: r7596 --- collects/macro-debugger/view/stepper.ss | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/collects/macro-debugger/view/stepper.ss b/collects/macro-debugger/view/stepper.ss index 79bfa143c4..9c24b1d819 100644 --- a/collects/macro-debugger/view/stepper.ss +++ b/collects/macro-debugger/view/stepper.ss @@ -313,13 +313,26 @@ (define end-box (box 0)) (send text get-visible-position-range start-box end-box) (update) - (send text scroll-to-position (unbox start-box) #f (unbox end-box))) - + (send text scroll-to-position (unbox start-box) #f (unbox end-box) 'start)) + ;; update/save-position : -> void (define/private (update/save-position) (save-position) - (update)) + (update/preserve-lines-view)) + ;; update/preserve-lines-view : -> void + (define/public (update/preserve-lines-view) + (define text (send sbview get-text)) + (define start-box (box 0)) + (define end-box (box 0)) + (send text get-visible-line-range start-box end-box) + (update) + (send text scroll-to-position + (send text line-start-position (unbox start-box)) + #f + (send text line-start-position (unbox end-box)) + 'start)) + ;; update : -> void ;; Updates the terms in the syntax browser to the current step (define/private (update)