Ignore:
Timestamp:
Apr 9, 2009, 11:04:15 PM (11 years ago)
Author:
rme
Message:

Merge trunk changes r11900 through r11919.

File:
1 edited

Legend:

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

    r11747 r11928  
    2727(def-cocoa-default *use-screen-fonts* :bool t "Use bitmap screen fonts when available")
    2828
     29(def-cocoa-default *option-is-meta* :bool t "Use option key as meta?")
    2930
    3031(defgeneric hemlock-view (ns-object))
     
    785786         (view (front-view-for-buffer buffer)))
    786787    (when view
    787       (hi::handle-hemlock-event view #'(lambda ()
    788                                          (hi:paste-characters position length
    789                                                               lisp-string))))))
     788      (let* ((edit-count (slot-value self 'edit-count)))
     789        (dotimes (i edit-count) (#/endEditing self))
     790        (hi::handle-hemlock-event view #'(lambda ()
     791                                           (hi:paste-characters position length
     792                                                                lisp-string)))
     793        (dotimes (i edit-count)
     794          (#/beginEditing self))))))
    790795
    791796(objc:defmethod (#/setAttributes:range: :void) ((self hemlock-text-storage)
     
    904909  (let* ((view (hemlock-view self))
    905910         ;; quote-p means handle characters natively
    906          (quote-p (and view (hi::hemlock-view-quote-next-p view))))
     911         (quote-p (and view (hi::hemlock-view-quote-next-p view)))
     912         (flags (#/modifierFlags event)))
    907913    #+debug (log-debug "~&quote-p ~s event ~s" quote-p event)
    908     (if (or (null view)
    909             (#/hasMarkedText self)
    910             (and quote-p (zerop (#/length (#/characters event))))) ;; dead key, e.g. option-E
    911       (call-next-method event)
    912       (unless (eventqueue-abort-pending-p self)
    913         (let ((hemlock-key (nsevent-to-key-event event quote-p)))
    914           (when hemlock-key
    915             (hi::handle-hemlock-event view hemlock-key)))))))
     914    (cond ((and (not *option-is-meta*)
     915                (logtest #$NSAlternateKeyMask flags))
     916           (call-next-method event))
     917          ((or (null view)
     918               (#/hasMarkedText self)
     919               (and quote-p (zerop (#/length (#/characters event)))))
     920           (call-next-method event))
     921          ((not (eventqueue-abort-pending-p self))
     922           (let ((hemlock-key (nsevent-to-key-event event quote-p)))
     923             (when hemlock-key
     924               (hi::handle-hemlock-event view hemlock-key)))))))
    916925
    917926(defmethod hi::handle-hemlock-event :around ((view hi:hemlock-view) event)
     
    29602969          ;; asserts that editing isn't in progress.  Once that's
    29612970          ;; fixed, this should be fixed as well.
    2962           #+not-broken (#/beginEditing textstorage)
     2971          (#/beginEditing textstorage)
    29632972          (#/replaceCharactersInRange:withString: textstorage selectedrange string)
    2964           #+not-broken (#/endEditing self))))))
     2973          (#/endEditing textstorage))))))
    29652974
    29662975
Note: See TracChangeset for help on using the changeset viewer.