Changeset 14490
- Timestamp:
- Dec 16, 2010, 3:50:56 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/source/cocoa-ide/cocoa-editor.lisp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/cocoa-ide/cocoa-editor.lisp
r14481 r14490 1131 1131 1132 1132 1133 1133 ;;; This assumes that NSBackgroundColorAttributeName can only be 1134 ;;; present id it's (possibly stale) paren highlighting info. 1135 ;;; We can't be sure of the locations (because of insertions/deletions), 1136 ;;; so remove the attribute from the entire textstorage. 1134 1137 (defmethod remove-paren-highlight ((self hemlock-textstorage-text-view)) 1135 #-cocotron 1136 (let* ((left (text-view-paren-highlight-left-pos self)) 1137 (right (text-view-paren-highlight-right-pos self))) 1138 (ns:with-ns-range (char-range left 1) 1139 (let* ((layout (#/layoutManager self))) 1140 (#/removeTemporaryAttribute:forCharacterRange: 1141 layout #&NSBackgroundColorAttributeName 1142 char-range) 1143 (setf (pref char-range #>NSRange.location) right) 1144 (#/removeTemporaryAttribute:forCharacterRange: 1145 layout #&NSBackgroundColorAttributeName 1146 char-range))))) 1138 (let* ((textstorage (#/textStorage self)) 1139 (len (#/length textstorage))) 1140 (#/beginEditing textstorage) 1141 (ns:with-ns-range (char-range 0 len) 1142 (#/removeAttribute:range: textstorage #&NSBackgroundColorAttributeName 1143 char-range)) 1144 (#/endEditing textstorage))) 1147 1145 1148 1146 (defmethod disable-paren-highlight ((self hemlock-textstorage-text-view)) … … 1153 1151 1154 1152 (defmethod compute-temporary-attributes ((self hemlock-textstorage-text-view)) 1155 #-cocotron1156 1153 (let* ((container (#/textContainer self)) 1157 1154 ;; If there's a containing scroll view, use its contentview … … 1191 1188 (attrs (#/dictionaryWithObject:forKey: ns:ns-dictionary 1192 1189 paren-highlight-color 1193 background))) 1194 (#/addTemporaryAttributes:forCharacterRange: 1195 layout attrs (ns:make-ns-range paren-highlight-left 1)) 1196 (#/addTemporaryAttributes:forCharacterRange: 1197 layout attrs (ns:make-ns-range paren-highlight-right 1)))))) 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))))))) 1198 1200 1199 1201 (defmethod update-paren-highlight ((self hemlock-textstorage-text-view)) … … 1328 1330 (setf (ns:ns-range-location range) start 1329 1331 (ns:ns-range-length range) len) 1330 (let ((attrs (#/dictionaryWithObject:forKey: 1331 ns:ns-dictionary 1332 (if (eq type :string) string-color comment-color) 1333 color-attribute))) 1334 (#/addTemporaryAttributes:forCharacterRange: 1335 layout attrs range))) 1332 (let ((attrs (if (eq type :string) string-color comment-color))) 1333 (#/addTemporaryAttribute:value:forCharacterRange: 1334 layout color-attribute attrs range))) 1336 1335 (setq last-end iend)))))))))) 1337 1336
Note:
See TracChangeset
for help on using the changeset viewer.
