Ignore:
Timestamp:
Dec 17, 2010, 2:22:23 AM (9 years ago)
Author:
gb
Message:

Suppress some cocotron-specific warnings.
Paren highlighting seems to work on Cocotron.

File:
1 edited

Legend:

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

    r14491 r14492  
    11161116  (unless *layout-text-in-background*
    11171117    (#/setDelegate: layout +null-ptr+)
     1118    #-cocotron
    11181119    (#/setBackgroundLayoutEnabled: layout nil)))
    11191120
     
    11501151
    11511152
    1152 (defmethod compute-temporary-attributes ((self hemlock-textstorage-text-view))    (let* ((container (#/textContainer self))
     1153(defmethod compute-temporary-attributes ((self hemlock-textstorage-text-view))
     1154  #-cocotron
     1155  (let* ((container (#/textContainer self))
    11531156         ;; If there's a containing scroll view, use its contentview         
    11541157         ;; Otherwise, just use the current view.
     
    11631166         (start (ns:ns-range-location char-range))
    11641167         (length (ns:ns-range-length char-range)))
    1165                                                                                     #-cocotron
    11661168    (when (> length 0)
    11671169      ;; Remove all temporary attributes from the character range
     
    11741176             (hi::*current-buffer* (buffer-cache-buffer cache)))
    11751177        (multiple-value-bind (start-line start-offset)
    1176                              (update-line-cache-for-index cache start)
     1178            (update-line-cache-for-index cache start)
    11771179          (let* ((end-line (update-line-cache-for-index cache (+ start length))))
    11781180            (set-temporary-character-attributes
     
    11801182             (- start start-offset)
    11811183             start-line
    1182              (hi::line-next end-line))))))
    1183     (when (eql #$YES (text-view-paren-highlight-enabled self))
    1184       (let* ((background #&NSBackgroundColorAttributeName)
    1185              (paren-highlight-left (text-view-paren-highlight-left-pos self))
    1186              (paren-highlight-right (text-view-paren-highlight-right-pos self))
    1187              (paren-highlight-color (text-view-paren-highlight-color self))
    1188              (attrs (#/dictionaryWithObject:forKey: ns:ns-dictionary
    1189                                                     paren-highlight-color
    1190                                                     background))
    1191              (ts (#/textStorage self)))
    1192         (ns:with-ns-range (left-range paren-highlight-left 1)
    1193           (ns:with-ns-range (right-range paren-highlight-right 1)
    1194             (#/beginEditing ts)
    1195             (#/addAttributes:range: ts attrs left-range)
    1196             ;(#/edited:range:changeInLength: ts #$NSTextStorageEditedAttributes left-range 0)
    1197             (#/addAttributes:range: ts attrs right-range)
    1198             ;(#/edited:range:changeInLength: ts #$NSTextStorageEditedAttributes right-range 0)
    1199             (#/endEditing ts)))))))
     1184             (hi::line-next end-line)))))))
     1185  (when (eql #$YES (text-view-paren-highlight-enabled self))
     1186    (let* ((background #&NSBackgroundColorAttributeName)
     1187           (paren-highlight-left (text-view-paren-highlight-left-pos self))
     1188           (paren-highlight-right (text-view-paren-highlight-right-pos self))
     1189           (paren-highlight-color (text-view-paren-highlight-color self))
     1190           (attrs (#/dictionaryWithObject:forKey: ns:ns-dictionary
     1191                                                  paren-highlight-color
     1192                                                  background))
     1193           (ts (#/textStorage self)))
     1194      (ns:with-ns-range (left-range paren-highlight-left 1)
     1195        (ns:with-ns-range (right-range paren-highlight-right 1)
     1196          (#/beginEditing ts)
     1197          (#/addAttributes:range: ts attrs left-range)
     1198          ;;(#/edited:range:changeInLength: ts #$NSTextStorageEditedAttributes left-range 0)
     1199          (#/addAttributes:range: ts attrs right-range)
     1200          ;;(#/edited:range:changeInLength: ts #$NSTextStorageEditedAttributes right-range 0)
     1201          (#/endEditing ts))))))
    12001202
    12011203(defmethod update-paren-highlight ((self hemlock-textstorage-text-view))
     
    12961298;;; HI::*CURRENT-BUFFER* is bound to the buffer containing START-LINE
    12971299;;; and END-LINE
     1300#-cocotron
    12981301(defun set-temporary-character-attributes (layout pos start-line end-line)
    12991302  (ns:with-ns-range (range)
     
    34973500                 string)
    34983501  (assume-cocoa-thread)
    3499   (let* ((doc (#/makeUntitledDocumentOfType:error: self #@"html" +null-ptr+)))
     3502  (let* ((doc #+cocotron (#/makeUntitledDocumentOfType: self #@"html")
     3503              #-cocotron (#/makeUntitledDocumentOfType:error: self #@"html" +null-ptr+)))
    35003504    (unless (%null-ptr-p doc)
    35013505      (#/addDocument: self doc)
Note: See TracChangeset for help on using the changeset viewer.