[mcclim-cvs] CVS mcclim/Drei
thenriksen
thenriksen at common-lisp.net
Wed Nov 8 17:52:55 UTC 2006
Update of /project/mcclim/cvsroot/mcclim/Drei
In directory clnet:/tmp/cvs-serv15306
Modified Files:
lisp-syntax.lisp fundamental-syntax.lisp drei-redisplay.lisp
Log Message:
Fix obscure redisplay issue that appeared when the input begins with
whitespace in the input-editor.
--- /project/mcclim/cvsroot/mcclim/Drei/lisp-syntax.lisp 2006/11/08 01:15:33 1.1
+++ /project/mcclim/cvsroot/mcclim/Drei/lisp-syntax.lisp 2006/11/08 17:52:55 1.2
@@ -2029,7 +2029,7 @@
(loop for child in (cdr children) do
(display-parse-tree child stream drei syntax))))
-(defmethod display-drei-contents (stream (drei drei) (syntax lisp-syntax))
+(defmethod display-drei-contents ((stream clim-stream-pane) (drei drei) (syntax lisp-syntax))
(with-slots (top bot) drei
(with-accessors ((cursor-positions cursor-positions)) syntax
;; There must always be room for at least one element of line
--- /project/mcclim/cvsroot/mcclim/Drei/fundamental-syntax.lisp 2006/11/08 01:15:33 1.1
+++ /project/mcclim/cvsroot/mcclim/Drei/fundamental-syntax.lisp 2006/11/08 17:52:55 1.2
@@ -109,7 +109,7 @@
pane (- tab-width (mod x tab-width)) 0))))
(incf start))))))
-(defmethod display-line (stream (drei drei) mark)
+(defmethod display-line ((stream clim-stream-pane) (drei drei) mark)
(let ((mark (clone-mark mark)))
(with-accessors ((space-width space-width) (tab-width tab-width)) stream
(let ((saved-offset nil)
@@ -120,7 +120,7 @@
saved-offset
mark)
'string)))
- (updating-output (stream :unique-id (cons stream (incf id))
+ (updating-output (stream :unique-id (cons drei (incf id))
:id-test #'equal
:cache-value contents
:cache-test #'equal)
@@ -162,7 +162,7 @@
(unless (end-of-buffer-p mark)
(terpri stream)))))))))
-(defmethod display-drei-contents (stream drei (syntax fundamental-syntax))
+(defmethod display-drei-contents ((stream clim-stream-pane) (drei drei) (syntax fundamental-syntax))
(with-slots (top bot) drei
(with-accessors ((cursor-positions cursor-positions)) syntax
(setf cursor-positions (make-array (1+ (number-of-lines-in-region top bot))
--- /project/mcclim/cvsroot/mcclim/Drei/drei-redisplay.lisp 2006/11/08 01:15:33 1.1
+++ /project/mcclim/cvsroot/mcclim/Drei/drei-redisplay.lisp 2006/11/08 17:52:55 1.2
@@ -53,6 +53,16 @@
(letf (((stream-default-view stream) (view drei)))
(call-next-method))))
+;; XXX: If the display begins with a blank area - for example spaces -
+;; CLIM will (rightly) think the output records position is at the
+;; first output. This is not good, because it means that the output
+;; record will "walk" across the screen if the buffer starts with
+;; blanks. Therefore, we make sure that an output record exists at the
+;; very beginning of the output.
+(defmethod display-drei-contents :before ((stream extended-output-stream) (drei drei-area) syntax)
+ (with-new-output-record (stream 'standard-sequence-output-record record)
+ (setf (output-record-position record) (stream-cursor-position stream))))
+
(defgeneric display-drei-cursor (stream drei cursor syntax)
(:documentation "Display the given cursor to `stream'.")
(:method :around ((stream extended-output-stream) (drei drei)
More information about the Mcclim-cvs
mailing list