Changeset 6595
- Timestamp:
- May 25, 2007, 4:47:22 AM (18 years ago)
- File:
-
- 1 edited
-
branches/ide-1.0/ccl/hemlock/src/line.lisp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/ide-1.0/ccl/hemlock/src/line.lisp
r6582 r6595 85 85 plist 86 86 ;; 87 ;; A slot that indicates whether this line is a buffered line, and if so 88 ;; contains information about how the text is stored. On the RT, this is 89 ;; the length of the text pointed to by the Line-%Chars. 90 (buffered-p ())) 87 ;; The (logical) origin within a buffer or disembodied region, or NIL 88 ;; if we aren't sure. 89 origin) 91 90 92 91 … … 129 128 :previous ,previous 130 129 :number ,number 131 :%buffer ,%buffer 132 :buffered-p 133 (line-buffered-p ,line) )) 130 :%buffer ,%buffer )) 134 131 135 132 ;;; Hide the fact that the slot isn't really called CHARS. … … 142 139 `(cond ((eq ,line *open-line*) 143 140 (+ *left-open-pos* (- *line-cache-length* *right-open-pos*))) 144 ((line-buffered-p ,line))145 141 (t 146 142 (length (the simple-string (line-%chars ,line)))))) 143 144 145 146 (defun get-line-origin (line) 147 (or (line-origin line) 148 (do* ((prev (line-previous line) (line-previous prev)) 149 (this line)) 150 ((or (null prev) (line-origin this)) 151 (let* ((start (or (line-origin this) 152 (setf (line-origin this) 0)))) 153 (do* ((next (line-next this) (line-next next))) 154 ((null next) 0) 155 (incf start (1+ (line-length this))) 156 (setq this next) 157 (setf (line-origin this) start) 158 (when (eq this line) (return start))))) 159 (setq this prev)))) 160 161 (defun adjust-line-origins-forward (line) 162 (let* ((stoart (get-line-origin line))) 163 (do* ((next (line-next line) (line-next next))) 164 ((null next)) 165 (incf start (1+ (line-length* line))) 166 (setf (line-origin next) start) 167 (setq line next))))
Note:
See TracChangeset
for help on using the changeset viewer.
