[mcclim-cvs] CVS mcclim/Drei

thenriksen thenriksen at common-lisp.net
Fri Mar 7 12:11:23 UTC 2008


Update of /project/mcclim/cvsroot/mcclim/Drei
In directory clnet:/tmp/cvs-serv2493/Drei

Modified Files:
	drei-redisplay.lisp 
Log Message:
Create proper pump states for fundamental syntax, don't assume the
offset is at the beginning of the line.


--- /project/mcclim/cvsroot/mcclim/Drei/drei-redisplay.lisp	2008/02/18 12:22:47	1.68
+++ /project/mcclim/cvsroot/mcclim/Drei/drei-redisplay.lisp	2008/03/07 12:11:22	1.69
@@ -827,6 +827,12 @@
 this pump state."
   line-index offset chunk-index)
 
+(defun chunk-for-offset (buffer-line offset)
+  "Return the index of the first chunk of `buffer-line' that
+contains `offset'."
+  (position (- offset (offset (start-mark buffer-line)))
+            (chunks buffer-line) :test #'<= :key #'car))
+
 (defun buffer-view-pump-state-for-offset (view offset)
   "Return a pump state usable for pumpting strokes for `view' (a
 `drei-buffer-view') from `offset'."
@@ -844,7 +850,8 @@
                     (setf low-index (1+ middle)))
                    ((mark< offset line-start)
                     (setf high-index middle)))
-          finally (return (make-pump-state middle offset 0)))))
+          finally (return (make-pump-state
+                           middle offset (chunk-for-offset this-line offset))))))
 
 (defun fetch-chunk (line chunk-index)
   "Retrieve the `chunk-index'th chunk from `line'. The return




More information about the Mcclim-cvs mailing list