Changeset 16188 for release


Ignore:
Timestamp:
Sep 4, 2014, 4:34:54 PM (4 years ago)
Author:
rme
Message:

Merge from trunk. Closes ticket:1151.

Location:
release/1.10/source
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • release/1.10/source

  • release/1.10/source/cocoa-ide/cocoa-editor.lisp

    r16088 r16188  
    25522552  (:metaclass ns:+ns-object))
    25532553
     2554;;; In certain cases, an NSTextView's selection changes without going
     2555;;; through setSelectedRange: or similar methods.  In post-10.6
     2556;;; systems, one of these cases is the find panel.  Synch up the
     2557;;; selections between the NSTextView and the Hemlock buffer here.
     2558(objc:defmethod (#/textViewDidChangeSelection: :void)
     2559    ((self hemlock-editor-window-controller) notification)
     2560  (let* ((hv (hemlock-view self))
     2561         (buffer (hi:hemlock-view-buffer hv))
     2562         (tv (#/object notification)))
     2563    (with-view-selection-info (tv buffer)
     2564      (let* ((range (#/selectedRange tv))
     2565             (v0 (ns:ns-range-location range))
     2566             (v1 (+ v0 (ns:ns-range-length range))))
     2567        (multiple-value-bind (b0 b1) (hi:buffer-selection-range buffer)
     2568          ;; If the selections differ, synch them up.
     2569          (unless (and (= b0 v0)
     2570                       (= b1 v1))
     2571            (let ((point (hi:buffer-point buffer)))
     2572              (hi:move-to-absolute-position point v0)
     2573              (when (> v1 v0)
     2574                (let ((mark (hi:copy-mark point :right-inserting)))
     2575                  (hi:move-to-absolute-position mark v1)
     2576                  (hemlock::%buffer-push-buffer-mark buffer mark t))))))))))
     2577
    25542578(objc:defmethod #/windowTitleForDocumentDisplayName: ((self hemlock-editor-window-controller) docname)
    25552579  (let* ((seq (slot-value self 'sequence)))
     
    30773101      (#/setDelegate: window controller)
    30783102      (setf (slot-value controller 'sequence) dupcount)
    3079       (#/setDelegate: (text-pane-text-view (slot-value window 'pane)) self)
     3103      (#/setDelegate: (text-pane-text-view (slot-value window 'pane)) controller)
    30803104      (#/addWindowController: self controller)
    30813105      (#/release controller)
  • release/1.10/source/cocoa-ide/cocoa-listener.lisp

    r16063 r16188  
    577577          (#/setBackgroundLayoutEnabled: layout nil))))
    578578    (#/setDelegate: window controller)
    579     (#/setDelegate: (text-pane-text-view (slot-value window 'pane)) self)
     579    (#/setDelegate: (text-pane-text-view (slot-value window 'pane)) controller)
    580580    (setf (slot-value controller 'sequence)
    581581          (slot-value self 'dupcount))
Note: See TracChangeset for help on using the changeset viewer.