Changeset 15605


Ignore:
Timestamp:
Jan 25, 2013, 4:31:45 PM (6 years ago)
Author:
gfoy
Message:

Show Documentation, take two.

Location:
trunk/cocoa-ide-contrib/foy
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/cocoa-ide-contrib/foy/hemlock-commands-cm/hemlock-commands-new.lisp

    r15604 r15605  
    128128  "Display the documentation for the symbol at point."
    129129  (declare (ignore p))
    130   (let* ((buffer-modified-p (hemlock-interface::buffer-modified (hemlock-interface::current-buffer)))
    131          (sym (parse-symbol))
     130  (let* ((sym (parse-symbol))
    132131         (hemlock-view (hi::current-view))
    133132         (pane (when hemlock-view (hi::hemlock-view-pane hemlock-view)))
     
    143142                         (format nil "No documentation found for ~S" sym) nil nil)))))
    144143            (t
    145              (hi::editor-error "Could not parse a valid symbol at point.")))
    146     (unless buffer-modified-p
    147       (setf (hemlock-interface::buffer-modified (hemlock-interface::current-buffer)) nil))))
     144             (hi::editor-error "Could not parse a valid symbol at point.")))))
    148145
    149146(hi::bind-key "Symbol Documentation" #k"control-x control-d")
  • trunk/cocoa-ide-contrib/foy/syntax-styling/syntax-styling-engine.lisp

    r15603 r15605  
    1212;;;      Mod history, most recent first:
    1313;;;
     14;;;      1/25/13   char-printable-p mod.
    1415;;;      1/23/13   handle-hemlock-event :around mod for 1.9 trunk.
    1516;;;      9/17/11   dummy set-file-type for ns:ns-window, set background-color
     
    972973                 (debug-out "~%code: ~s" code))
    973974    (let ((control-key-p (hi::key-event-bit-p event "Control"))
    974           (option-key-p (hi::key-event-bit-p event "Meta")))
     975          (option-key-p (hi::key-event-bit-p event "Meta"))
     976          (control-x-p (and *prev-event* (key-event= *prev-event* %control-x%))))
    975977      #+sax-debug
    976978      (when *automated-testing-p*
     
    979981      #+sax-debug (when *char-printable-p-debug* (debug-out "~%control-key-p: ~s" control-key-p))
    980982      #+sax-debug (when *char-printable-p-debug* (debug-out "~%option-key-p: ~s" option-key-p))
     983      #+sax-debug (when *char-printable-p-debug* (debug-out "~%*prev-event*: ~s" *prev-event*))
     984      #+sax-debug (when *char-printable-p-debug* (debug-out "~%control-x-p: ~s" control-x-p))
    981985      (cond ((not (or control-key-p option-key-p))
    982986             (when (or (and (>= code 32) (<= code 127)) ; this is the primary case
     
    989993               t))
    990994            #+elvis
    991             ((and control-key-p option-key-p) 
     995            ((and control-key-p option-key-p)
    992996             #+sax-debug (when *char-printable-p-debug* (debug-out "~%printable2"))
    993997             (when (or (= code 8)) ; control-meta-h & control-meta-delete ****
    994998               t))
    995             (control-key-p
     999            ;; Exclude control-x combinations
     1000            ((and control-key-p (not control-x-p))
    9961001             (when (or (= code 100) ; control-d
    9971002                       ;; (= code 4) ; *** ?
     
    10371042             #+sax-debug (when *handle-hemlock-event-debug*
    10381043                           (debug-out "~%~%~S" 'handle-hemlock-event)
    1039                            (debug-out "~%char: ~S" char))
     1044                           (debug-out "~%char: ~S" char)
     1045                           (debug-out "~%keysym: ~S" keysym)
     1046                           (debug-out "~%event: ~S" event))
    10401047             (when (key-event= event %control-y%)
    10411048               #+sax-debug (when *handle-hemlock-event-debug*
     
    10521059                            (key-event= event %control-e%)))
    10531060               (setq *style-top-level-form-p* t))
    1054              (setq *prev-event* event)
    10551061             (if (and char (not (typep (#/window (hi::hemlock-view-pane view)) 'gui::hemlock-listener-frame))
    10561062                      (char-printable-p char event) (or (lisp-file-p) (scheme-file-p) (clojure-file-p)))
     
    11131119                                           (hi::hemlock-view-buffer view))           
    11141120             (ccl::with-autorelease-pool
    1115                  (call-next-method view event)))))))
     1121                 (call-next-method view event)))))
     1122    (setq *prev-event* event)))
     1123
    11161124
    11171125;;; *** redefinition ***
  • trunk/cocoa-ide-contrib/foy/syntax-styling/syntax-styling-specials.lisp

    r14988 r15605  
    1414;;;      Mod History, most recent first:
    1515;;;
     16;;;      1/25/13   improved key-event=
    1617;;;      9/17/11   %sharp-underscore-forward-pattern%
    1718;;;      9/7/11    update for ccl 1.7
     
    593594
    594595(defun key-event= (k1 k2)
    595   (and (= (hi::key-event-keysym k1) (hi::key-event-keysym k2))
    596        (= (hi::key-event-bits k1) (hi::key-event-bits k2))))
     596  (when (and (typep k1 'hi::key-event)
     597             (typep k2 'hi::key-event))
     598    (let ((k1-sym (hi::key-event-keysym k1))
     599          (k2-sym (hi::key-event-keysym k2)))
     600      (when (and (numberp k1-sym) (numberp k2-sym)) ; syms can be keywords
     601        (and (= k1-sym k2-sym)
     602             (= (hi::key-event-bits k1) (hi::key-event-bits k2)))))))
    597603
    598604(defMethod hemlock-update ((view hi:hemlock-view) start end &optional count)
Note: See TracChangeset for help on using the changeset viewer.