diff options
author | Bozhidar Batsov <bozhidar@batsov.com> | 2014-04-26 01:13:04 +0300 |
---|---|---|
committer | Bozhidar Batsov <bozhidar@batsov.com> | 2014-04-26 01:13:04 +0300 |
commit | 8731cb5c00ebca15181b0b99e5d3986b6da36517 (patch) | |
tree | 871013ab9977c34f0dad7056b19c05923548ee3d | |
parent | 44974a6da0750d80feb14f0cfcaf9ca075501759 (diff) | |
parent | 266eba3565ce3287117672d2ab60dc3e5afdbb18 (diff) |
Merge pull request #539 from jeffvalk/master
Enable 'jump' keybindings for stacktrace navigation.
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | cider-interaction.el | 3 | ||||
-rw-r--r-- | cider-stacktrace.el | 9 |
3 files changed, 12 insertions, 2 deletions
@@ -564,7 +564,7 @@ Keyboard shortcut | Description Keyboard shortcut | Description --------------------------------|------------------------------- -<kbd>Return</kbd> | navigate to the source location (if available) for the stacktrace frame +<kbd>Return</kbd> and <kbd>M-.</kbd> | navigate to the source location (if available) for the stacktrace frame <kbd>j</kbd> | toggle display of java frames <kbd>c</kbd> | toggle display of clj frames <kbd>r</kbd> | toggle display of repl frames diff --git a/cider-interaction.el b/cider-interaction.el index e580292e..f5ff7d16 100644 --- a/cider-interaction.el +++ b/cider-interaction.el @@ -553,7 +553,8 @@ added as a prefix to the LOCATION." ((and path (file-exists-p path)) (find-file path)) (t (cider-find-resource resource))) (goto-char (point-min)) - (forward-line (1- line)))) + (forward-line (1- line)) + (cider-mode 1))) ; enable cider-jump keybindings on java sources (defun cider--jump-to-def-op-fn (var) "Jump to VAR def by using the nREPL info op." diff --git a/cider-stacktrace.el b/cider-stacktrace.el index f96ba8b1..88f21b51 100644 --- a/cider-stacktrace.el +++ b/cider-stacktrace.el @@ -78,6 +78,7 @@ (defvar cider-stacktrace-mode-map (let ((map (make-sparse-keymap))) + (define-key map (kbd "M-.") 'cider-stacktrace-jump) (define-key map "j" 'cider-stacktrace-toggle-java) (define-key map "c" 'cider-stacktrace-toggle-clj) (define-key map "r" 'cider-stacktrace-toggle-repl) @@ -214,6 +215,14 @@ Update `cider-stacktrace-hidden-frame-count' and indicate filters applied." (cider-jump-to-def-for (vector file file line)) (error "No source info"))))) +(defun cider-stacktrace-jump () + "Like `cider-jump', but uses the stack frame source at point, if available." + (interactive) + (let ((button (button-at (point)))) + (if (and button (button-get button 'line)) + (cider-stacktrace-navigate button) + (call-interactively 'cider-jump)))) + ;; Rendering |