Changeset 6622
- Timestamp:
- May 28, 2007, 12:51:56 AM (18 years ago)
- File:
-
- 1 edited
-
branches/ide-1.0/ccl/examples/cocoa-editor.lisp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/ide-1.0/ccl/examples/cocoa-editor.lisp
r6614 r6622 536 536 #+debug 537 537 (#_NSLog #@"Attributes at index: %d" :unsigned index) 538 # -no538 #+no 539 539 (let* ((buffer-cache (hemlock-buffer-string-cache (slot-value self 'string))) 540 540 (buffer (buffer-cache-buffer buffer-cache)) … … 562 562 (pref rangeptr :<NSR>ange.length) len)) 563 563 (svref *styles* style))) 564 # +no564 #-no 565 565 (with-slots (cache) self 566 566 (let* ((attrs (#/attributesAtIndex:effectiveRange: cache index rangeptr))) … … 1682 1682 n)))) 1683 1683 1684 (defun buffer-active-font (buffer) 1685 (let* ((style 0) 1686 (region (hi::buffer-active-font-region buffer))) 1687 (when region 1688 (let* ((start (hi::region-end region))) 1689 (setq style (hi::font-mark-font start)))) 1690 (svref *styles* style))) 1691 1684 1692 (defun hi::buffer-note-insertion (buffer mark n) 1685 1693 (when (hi::bufferp buffer) … … 1689 1697 (let* ((pos (mark-absolute-position mark)) 1690 1698 (cache (#/cache textstorage)) 1691 (hemlock-string (#/string textstorage))) 1699 (hemlock-string (#/string textstorage)) 1700 (display (hemlock-buffer-string-cache hemlock-string)) 1701 (buffer (buffer-cache-buffer display)) 1702 (font (buffer-active-font buffer))) 1692 1703 (unless (eq (hi::mark-%kind mark) :right-inserting) 1693 1704 (decf pos n)) 1694 1705 #+debug 1695 (format t "~&insert: pos = ~d, n = ~d" pos n) 1696 (let* ((display (hemlock-buffer-string-cache hemlock-string))) 1697 ;(reset-buffer-cache display) 1698 (adjust-buffer-cache-for-insertion display pos n) 1699 (update-line-cache-for-index display pos)) 1706 (#_NSLog #@"insert: pos = %d, n = %d" :int pos :int n) 1707 ;;(reset-buffer-cache display) 1708 (adjust-buffer-cache-for-insertion display pos n) 1709 (update-line-cache-for-index display pos) 1700 1710 (#/replaceCharactersInRange:withString: 1701 1711 cache (ns:make-ns-range pos 0) 1702 (#/substringWithRange: hemlock-string (ns:make-ns-range pos n))) 1712 (#/substringWithRange: hemlock-string (ns:make-ns-range pos n))) 1713 (#/setAttributes:range: cache font (ns:make-ns-range pos n)) 1703 1714 #-all-in-cocoa-thread 1704 1715 (textstorage-note-insertion-at-position textstorage pos n) … … 1936 1947 (let* ((textstorage (slot-value self 'textstorage)) 1937 1948 (display (hemlock-buffer-string-cache (#/string textstorage)))) 1949 (reset-buffer-cache display) 1938 1950 (#/updateCache textstorage) 1939 (reset-buffer-cache display)1940 1951 (update-line-cache-for-index display 0) 1941 1952 (textstorage-note-insertion-at-position … … 2100 2111 (setq *hemlock-document-controller* (call-next-method)) 2101 2112 (setf (slot-value *hemlock-document-controller* 'last-encoding) 0)))) 2113 2114 (defun iana-charset-name-of-nsstringencoding (ns) 2115 (#_CFStringConvertEncodingToIANACharSetName 2116 (#_CFStringConvertNSStringEncodingToEncoding ns))) 2117 2102 2118 2103 2119 ;;; Return a list of :<NSS>tring<E>ncodings, sorted by the
Note:
See TracChangeset
for help on using the changeset viewer.
