Changeset 14560
- Timestamp:
- Jan 7, 2011, 10:18:51 AM (14 years ago)
- File:
-
- 1 edited
-
trunk/source/cocoa-ide/cocoa-editor.lisp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/cocoa-ide/cocoa-editor.lisp
r14536 r14560 1132 1132 1133 1133 1134 ;;; This assumes that NSBackgroundColorAttributeName can only be1135 ;;; present id it's (possibly stale) paren highlighting info.1136 ;;; We can't be sure of the locations (because of insertions/deletions),1137 ;;; so remove the attribute from the entire textstorage.1138 1134 (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: layout 1141 #&NSBackgroundColorAttributeName 1142 char-range) 1143 (setf (pref char-range #>NSRange.location) right) 1144 (#/removeTemporaryAttribute:forCharacterRange: layout 1145 #&NSBackgroundColorAttributeName 1146 char-range)))) 1147 ;;; This assumes that NSBackgroundColorAttributeName can only be 1148 ;;; present id it's (possibly stale) paren highlighting info. 1149 ;;; We can't be sure of the locations (because of insertions/deletions), 1150 ;;; so remove the attribute from the entire textstorage. 1151 #+cocotron 1139 1152 (let* ((textstorage (#/textStorage self)) 1140 1153 (len (#/length textstorage))) 1141 1154 (#/beginEditing textstorage) 1142 (ns:with-ns-range (char-range 0 len)1155 (ns:with-ns-range (char-range 0 len) 1143 1156 (#/removeAttribute:range: textstorage #&NSBackgroundColorAttributeName 1144 1157 char-range)) … … 1190 1203 (attrs (#/dictionaryWithObject:forKey: ns:ns-dictionary 1191 1204 paren-highlight-color 1192 background)) 1193 (ts (#/textStorage self))) 1205 background))) 1194 1206 (ns:with-ns-range (left-range paren-highlight-left 1) 1195 1207 (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)))))) 1208 #-cocotron 1209 (let ((layout (#/layoutManager (#/textContainer self)))) 1210 (#/addTemporaryAttributes:forCharacterRange: layout attrs left-range) 1211 (#/addTemporaryAttributes:forCharacterRange: layout attrs right-range)) 1212 #+cocotron 1213 (let ((ts (#/textStorage self))) 1214 (#/beginEditing ts) 1215 (#/addAttributes:range: ts attrs left-range) 1216 (#/addAttributes:range: ts attrs right-range) 1217 (#/endEditing ts))))))) 1202 1218 1203 1219 (defmethod update-paren-highlight ((self hemlock-textstorage-text-view))
Note:
See TracChangeset
for help on using the changeset viewer.
