Changeset 12543


Ignore:
Timestamp:
Aug 6, 2009, 5:51:00 PM (10 years ago)
Author:
rme
Message:

Some hacks to allow use of xhemlock-text-storage.

  • guard access to styles slot
  • disable paren highlighting when using xhemlock-text-storage for now
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/cocoa-ide/cocoa-editor.lisp

    r12526 r12543  
    394394  ;; TODO: figure out if updating the cache matters, and if not, use hi:move-to-absolute-position.
    395395  (let* ((hi::*current-buffer* (buffer-cache-buffer cache)))
     396    (hi::move-to-absolute-position mark abspos)
     397    #+rme-deletion
    396398    (multiple-value-bind (line idx) (update-line-cache-for-index cache abspos)
    397399      #+debug
     
    485487                   (buffer-cache-workline-length cache)))))))
    486488
    487                      
    488 
    489 
    490 
    491489;;; For debugging, mostly: make the printed representation of the string
    492490;;; referenence the named Hemlock buffer.
     
    859857(defun close-hemlock-textstorage (ts)
    860858  (declare (type hemlock-text-storage ts))
    861   (with-slots (styles) ts
    862     (#/release styles)
    863     (setq styles +null-ptr+))
     859  (when (slot-exists-p ts 'styles)
     860    (with-slots (styles) ts
     861      (#/release styles)
     862      (setq styles +null-ptr+)))
    864863  (let* ((hemlock-string (slot-value ts 'hemlock-string)))
    865864    (setf (slot-value ts 'hemlock-string) +null-ptr+)
     
    11561155
    11571156
    1158 
    11591157(defmethod compute-temporary-attributes ((self hemlock-textstorage-text-view))
     1158  (unless (#/isKindOfClass: (#/textStorage self)
     1159                            (ccl::@class hemlock-text-storage))
     1160    ;; XXX buffer string cache isssues
     1161    (return-from compute-temporary-attributes +null-ptr+))
    11601162  #-cocotron
    11611163  (let* ((container (#/textContainer self))
     
    14821484  (hemlock-buffer-string-cache (#/hemlockString (#/textStorage self))))
    14831485
    1484 #-cocotron                              ; for now, small struct return FFI issue
     1486#-cocotron                             ; for now, small struct return FFI issue
    14851487(objc:defmethod (#/selectionRangeForProposedRange:granularity: :ns-range)
    14861488    ((self hemlock-textstorage-text-view)
     
    18031805                (#/setAutoresizingMask: tv #$NSViewWidthSizable)
    18041806                (#/setBackgroundColor: tv color)
    1805                 (#/setTypingAttributes: tv (#/objectAtIndex: (#/styles textstorage) style))
     1807                (when (slot-exists-p textstorage 'styles)
     1808                  (#/setTypingAttributes: tv (#/objectAtIndex:
     1809                                              (#/styles textstorage) style)))
    18061810                #-cocotron
    18071811                (#/setSmartInsertDeleteEnabled: tv nil)
     
    25212525  (let* ((doc (%inc-ptr self 0))        ; workaround for stack-consed self
    25222526         (string (#/hemlockString ts))
    2523          (cache (hemlock-buffer-string-cache string))
    2524          (buffer (buffer-cache-buffer cache)))
     2527         (buffer (hemlock-buffer string)))
    25252528    (unless (%null-ptr-p doc)
    25262529      (setf (slot-value doc 'textstorage) ts
Note: See TracChangeset for help on using the changeset viewer.