Changeset 14363
- Timestamp:
- Oct 13, 2010, 8:55:32 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/source/cocoa-ide/cocoa-editor.lisp (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/cocoa-ide/cocoa-editor.lisp
r14249 r14363 570 570 ;;; This runs on the main thread; it synchronizes the "real" NSMutableAttributedString 571 571 ;;; with the hemlock string and informs the textstorage of the insertion. 572 (objc:defmethod (#/noteHemlockInsertionAtPosition:length: :void) ((self hemlock-text-storage)572 (objc:defmethod (#/noteHemlockInsertionAtPosition:length:extra: :void) ((self hemlock-text-storage) 573 573 (pos :<NSI>nteger) 574 574 (n :<NSI>nteger) … … 601 601 (textstorage-note-insertion-at-position self pos n))) 602 602 603 (objc:defmethod (#/noteHemlockDeletionAtPosition:length: :void) ((self hemlock-text-storage)604 (pos :<NSI>nteger)605 (n :<NSI>nteger)606 (extra :<NSI>nteger))603 (objc:defmethod (#/noteHemlockDeletionAtPosition:length:extra: :void) ((self hemlock-text-storage) 604 (pos :<NSI>nteger) 605 (n :<NSI>nteger) 606 (extra :<NSI>nteger)) 607 607 (declare (ignorable extra)) 608 608 #+debug … … 628 628 (update-line-cache-for-index display pos)))) 629 629 630 (objc:defmethod (#/noteHemlockModificationAtPosition:length: :void) ((self hemlock-text-storage)631 (pos :<NSI>nteger)632 (n :<NSI>nteger)633 (extra :<NSI>nteger))630 (objc:defmethod (#/noteHemlockModificationAtPosition:length:extra: :void) ((self hemlock-text-storage) 631 (pos :<NSI>nteger) 632 (n :<NSI>nteger) 633 (extra :<NSI>nteger)) 634 634 (declare (ignorable extra)) 635 635 #+debug … … 650 650 pos n deleted-string))))) 651 651 652 (objc:defmethod (#/noteHemlockAttrChangeAtPosition:length: :void) ((self hemlock-text-storage)653 (pos :<NSI>nteger)654 (n :<NSI>nteger)655 (fontnum :<NSI>nteger))652 (objc:defmethod (#/noteHemlockAttrChangeAtPosition:length:fontNum: :void) ((self hemlock-text-storage) 653 (pos :<NSI>nteger) 654 (n :<NSI>nteger) 655 (fontnum :<NSI>nteger)) 656 656 (ns:with-ns-range (range pos n) 657 657 (#/setAttributes:range: (#/mirror self) (#/objectAtIndex: (#/styles self) fontnum) range) … … 665 665 (#/instanceMethodSignatureForSelector: 666 666 hemlock-text-storage 667 (@selector #/noteHemlockInsertionAtPosition:length: ))))))667 (@selector #/noteHemlockInsertionAtPosition:length:extra:)))))) 668 668 669 669 (defstatic *buffer-change-invocation-lock* (make-lock)) … … 2387 2387 (pos (hi:mark-absolute-position (hi::region-start region))) 2388 2388 (n (- (hi:mark-absolute-position (hi::region-end region)) pos))) 2389 (perform-edit-change-notification textstorage 2390 (@selector #/noteHemlockAttrChangeAtPosition:length:) 2391 pos 2392 n 2393 font)))) 2389 (if (eq *current-process* *cocoa-event-process*) 2390 (#/noteHemlockAttrChangeAtPosition:length:fontNum: textstorage 2391 pos 2392 n 2393 font) 2394 (perform-edit-change-notification textstorage 2395 (@selector #/noteHemlockAttrChangeAtPosition:length:fontNum:) 2396 pos 2397 n 2398 font))))) 2394 2399 2395 2400 (defun buffer-active-font-attributes (buffer) … … 2415 2420 ;; For :right-inserting and :temporary marks, they should be left back. 2416 2421 (decf pos n)) 2417 (perform-edit-change-notification textstorage 2418 (@selector #/noteHemlockInsertionAtPosition:length:) 2419 pos 2420 n)))))) 2422 (if (eq *current-process* *cocoa-event-process*) 2423 (#/noteHemlockInsertionAtPosition:length:extra: textstorage 2424 pos 2425 n 2426 0) 2427 (perform-edit-change-notification textstorage 2428 (@selector #/noteHemlockInsertionAtPosition:length:extra:) 2429 pos 2430 n))))))) 2421 2431 2422 2432 (defun hemlock-ext:buffer-note-modification (buffer mark n) … … 2425 2435 (textstorage (if document (slot-value document 'textstorage)))) 2426 2436 (when textstorage 2427 (perform-edit-change-notification textstorage 2428 (@selector #/noteHemlockModificationAtPosition:length:) 2429 (hi:mark-absolute-position mark) 2430 n))))) 2437 (if (eq *current-process* *cocoa-event-process*) 2438 (#/noteHemlockModificationAtPosition:length:extra: textstorage 2439 (hi:mark-absolute-position mark) 2440 n 2441 0) 2442 (perform-edit-change-notification textstorage 2443 (@selector #/noteHemlockModificationAtPosition:length:extra:) 2444 (hi:mark-absolute-position mark) 2445 n)))))) 2431 2446 2432 2447 … … 2437 2452 (when textstorage 2438 2453 (let* ((pos (hi:mark-absolute-position mark))) 2439 (perform-edit-change-notification textstorage 2440 (@selector #/noteHemlockDeletionAtPosition:length:) 2441 pos 2442 (abs n))))))) 2454 (if (eq *current-process* *cocoa-event-process*) 2455 (#/noteHemlockDeletionAtPosition:length:extra: textstorage 2456 pos 2457 (abs n) 2458 0) 2459 (perform-edit-change-notification textstorage 2460 (@selector #/noteHemlockDeletionAtPosition:length:extra:) 2461 pos 2462 (abs n)))))))) 2443 2463 2444 2464
Note:
See TracChangeset
for help on using the changeset viewer.
