Changeset 721
- Timestamp:
- Mar 24, 2004, 5:06:36 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/ccl/examples/cocoa-editor.lisp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ccl/examples/cocoa-editor.lisp
r717 r721 49 49 (defun make-hemlock-buffer (&rest args) 50 50 (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)))) 56 59 57 60 ;;; Define some key event modifiers. … … 342 345 :edited #$NSTextStorageEditedCharacters 343 346 :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)))) 345 351 346 352 (define-objc-method ((:void :note-modification params) hemlock-text-storage) … … 386 392 ;;; hemlock-buffer-string.) 387 393 (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)))390 394 (make-objc-instance 'hemlock-text-storage 391 395 :with-string … … 998 1002 999 1003 (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))) 1001 1006 (setf (hi::buffer-document buffer) nil) 1002 1007 (unwind-protect … … 1284 1289 (setf (slot-value doc 'textstorage) 1285 1290 (make-textstorage-for-hemlock-buffer buffer) 1286 (hi::buffer-gap-context buffer) (hi::make-buffer-gap-context)1287 1291 (hi::buffer-document buffer) doc))) 1288 1292 doc)) … … 1300 1304 (setf (hi::buffer-pathname b) pathname) 1301 1305 (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)) 1305 1307 b))) 1308 (hi::*buffer-gap-context* (hi::buffer-gap-context buffer)) 1306 1309 (data (make-objc-instance 'ns:ns-data 1307 1310 :with-contents-of-file filename)) … … 1365 1368 1366 1369 (define-objc-method ((:void make-window-controllers) hemlock-editor-document) 1370 #+debug 1371 (#_NSLog #@"Make window controllers") 1367 1372 (let* ((controller (make-objc-instance 1368 1373 'hemlock-editor-window-controller
Note:
See TracChangeset
for help on using the changeset viewer.
