Changeset 721


Ignore:
Timestamp:
Mar 24, 2004, 5:06:36 PM (21 years ago)
Author:
Gary Byers
Message:

Update the buffer-cache after processing deletion notification.
MAKE-HEMLOCK-BUFFER makes the gap-context, used to make all buffers except
echo area.
NSSTRING-TO-BUFFER needs to set up gap context.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/examples/cocoa-editor.lisp

    r717 r721  
    4949(defun make-hemlock-buffer (&rest args)
    5050  (let* ((buf (apply #'hi::make-buffer args)))
    51     (or buf
    52         (progn
    53           (format t "~& couldn't make hemlock buffer with args ~s" args)
    54           (dbg)
    55           nil))))
     51    (if buf
     52      (progn
     53        (setf (hi::buffer-gap-context buf) (hi::make-buffer-gap-context))
     54        buf)
     55      (progn
     56        (format t "~& couldn't make hemlock buffer with args ~s" args)
     57        (dbg)
     58        nil))))
    5659         
    5760;;; Define some key event modifiers.
     
    342345          :edited #$NSTextStorageEditedCharacters
    343346          :range (ns-make-range pos n)
    344           :change-in-length (- n))))
     347          :change-in-length (- n))
     348    (let* ((display (hemlock-buffer-string-cache (send self 'string))))
     349            (reset-buffer-cache display)
     350            (update-line-cache-for-index display pos))))
    345351
    346352(define-objc-method ((:void :note-modification params) hemlock-text-storage)
     
    386392;;; hemlock-buffer-string.)
    387393(defun make-textstorage-for-hemlock-buffer (buffer)
    388   (unless (hi::buffer-gap-context buffer)
    389     (setf (hi::buffer-gap-context buffer) (hi::make-buffer-gap-context)))
    390394  (make-objc-instance 'hemlock-text-storage
    391395                      :with-string
     
    9981002
    9991003(defun nsstring-to-buffer (nsstring buffer)
    1000   (let* ((document (hi::buffer-document buffer)))
     1004  (let* ((document (hi::buffer-document buffer))
     1005         (hi::*buffer-gap-context* (hi::buffer-gap-context buffer)))
    10011006    (setf (hi::buffer-document buffer) nil)
    10021007    (unwind-protect
     
    12841289        (setf (slot-value doc 'textstorage)
    12851290              (make-textstorage-for-hemlock-buffer buffer)
    1286               (hi::buffer-gap-context buffer) (hi::make-buffer-gap-context)
    12871291              (hi::buffer-document buffer) doc)))
    12881292    doc))
     
    13001304                    (setf (hi::buffer-pathname b) pathname)
    13011305                    (setf (slot-value self 'textstorage)
    1302                           (make-textstorage-for-hemlock-buffer b)
    1303                           (hi::buffer-gap-context b)
    1304                           (hi::make-buffer-gap-context))
     1306                          (make-textstorage-for-hemlock-buffer b))
    13051307                    b)))
     1308         (hi::*buffer-gap-context* (hi::buffer-gap-context buffer))
    13061309         (data (make-objc-instance 'ns:ns-data
    13071310                                   :with-contents-of-file filename))
     
    13651368 
    13661369(define-objc-method ((:void make-window-controllers) hemlock-editor-document)
     1370  #+debug
     1371  (#_NSLog #@"Make window controllers")
    13671372  (let* ((controller (make-objc-instance
    13681373                      'hemlock-editor-window-controller
Note: See TracChangeset for help on using the changeset viewer.