(call-next-method widget)
(let ((cursor (text-widget-cursor-ink widget)))
(if cursor
- (let ((mark (cursor-ink-point cursor)))
- (fix-ink-remove! cursor)
- (if mark (mark-temporary! mark)))))
+ (fix-ink-remove! cursor)))
(and-let* ((drawing (text-widget-override-drawing widget))
(ink (car (fix-drawing-display-list drawing)))
((text-ink? ink))
(let ((window (text-widget-buffer-frame widget))
(cursor (text-widget-cursor-ink widget)))
(%trace ";\t cursor: "cursor"\n")
+ (redraw-cursor widget (window-point window))
- (define (in-change-region? point)
- (let ((group (mark-group point))
- (index (mark-index point)))
- (let ((start (group-start-changes-index group))
- (end (group-end-changes-index group)))
- (and start (fix:<= start index) (fix:<= index end)))))
-
- (let ((window-point (window-point window))
- (cursor-point (cursor-ink-point cursor)))
- (cond ((and cursor-point
- (mark= cursor-point window-point)
- (not (in-change-region? cursor-point)))
- (%trace ";\t unchanged at "(mark-index cursor-point)
- " = "(mark-index window-point)" ("
- (and (in-change-region? cursor-point) #t)")\n"))
- ((and cursor-point
- (mark= cursor-point window-point))
- (%trace ";\t in change region"
- " at "(mark-index cursor-point)
- " ("(mark-index window-point)")\n")
- (redraw-cursor widget window-point))
- (cursor-point
- (%trace ";\t changed from "(mark-index cursor-point)
- " to "(mark-index window-point)"\n")
- (redraw-cursor widget window-point))
- (else
- (%trace ";\t new at "(mark-index window-point)"\n")
- (set-cursor-ink-point! cursor
- (mark-permanent-copy window-point))
- (redraw-cursor widget window-point))))
;; Get cursor appearance right per current mode. An active
;; typein window looks selected, else invisible. An active buffer
;; looks selected, else visible.
(let ((half-width (quotient (gtk-screen-char-width screen) 2))
(line-height (gtk-screen-line-height screen)))
(set-box-ink! cursor x y half-width line-height))
- (move-mark-to! (cursor-ink-point cursor) point)
#t)
(define (set-box! x y width height)
(if (fix:< width 5)
(set-box-ink! cursor x y 5 height)
(set-box-ink! cursor x y width height))
- (move-mark-to! (cursor-ink-point cursor) point)
#t)
(main)))
;; #t if the cursor should be drawn.
(visible? define standard initial-value #t)
- ;; The index (a marker) at which the cursor was last placed.
- (point define standard initial-value #f)
-
;; A list of one <fix-layout>. Used to blink this ink "on"
;; (restore its ink-widgets list) withOUT consing.
(widget-list define standard))