From 22fee824e59252e29897e8d4586a890c56654753 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Mon, 6 Aug 2012 12:12:24 -0500 Subject: [PATCH] add some highlighting to the line numbers to show where the insertion point currently is closes PR 12976 original commit: 94a448413ee9b371bc7822f27ac422776cf1ca3a --- collects/framework/private/text.rkt | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/collects/framework/private/text.rkt b/collects/framework/private/text.rkt index 51098ab9..9e8d8d7a 100644 --- a/collects/framework/private/text.rkt +++ b/collects/framework/private/text.rkt @@ -4081,7 +4081,7 @@ designates the character that triggers autocompletion (get-highlight-background-color) (if (preferences:get 'framework:white-on-black?) "lime" - "forestgreen")) + "forestgreen")) 'solid) (send dc draw-rectangle ls final-y (- right-space single-w) single-h) @@ -4171,13 +4171,22 @@ designates the character that triggers autocompletion (define old-position #f) (define/augment (after-set-position) - (when old-position - (invalidate-at-position old-position)) - (set! old-position (and (= (get-start-position) - (get-end-position)) - (get-start-position))) - (when old-position - (invalidate-at-position old-position)) + (cond + [(and old-position + (= (get-start-position) + (get-end-position)) + (= (position-line old-position) + (position-line (get-start-position)))) + ;; when the line stays the same, don't invalidate anything + (set! old-position (get-start-position))] + [else + (when old-position + (invalidate-at-position old-position)) + (set! old-position (and (= (get-start-position) + (get-end-position)) + (get-start-position))) + (when old-position + (invalidate-at-position old-position))]) (inner (void) after-set-position)) (define/private (invalidate-at-position pos)