Changeset 13130


Ignore:
Timestamp:
Oct 29, 2009, 10:41:40 PM (10 years ago)
Author:
gz
Message:

in split-line-charpos: don't crash if line-charprops-changes is an empty vector

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/cocoa-ide/hemlock/src/charprops.lisp

    r12859 r13130  
    187187;;; before and after charpos.
    188188(defun split-line-charprops (line charpos)
    189   (let ((changes (line-charprops-changes line)))
    190     (when changes
     189  (let* ((changes (line-charprops-changes line))
     190         (nchanges (length changes)))
     191    (when (> nchanges 0)
    191192      (let ((left (make-array 2 :adjustable t :fill-pointer 0))
    192193            (right (make-array 2 :adjustable t :fill-pointer 0))
     
    196197              (change nil))
    197198             ((or pivot
    198                   (= i (length changes)))
     199                  (= i nchanges))
    199200              (if (null pivot)
    200201                ;; The last change extends to the end of line, so that will be the
     
    214215                      (setf (charprops-change-index c) 0)
    215216                      (push-charprops-change c right)))
    216                   (loop for i from pivot below (length changes)
     217                  (loop for i from pivot below nchanges
    217218                    as change = (aref changes i)
    218219                    do (decf (charprops-change-index change) charpos)
Note: See TracChangeset for help on using the changeset viewer.