Skip to content

Commit

Permalink
python: fixes for anaconda-mode-view-mode
Browse files Browse the repository at this point in the history
* layers/+lang/python/funcs.el (spacemacs/anaconda-view-forward-and-push):
  Added helper function to go forward and hit RET
* layers/+lang/python/packages.el (python/init-anaconda-mode):
   - use new evilification macro
   - use helper function to go ahead and push button when hitting `RET`
   - Add `C-j`, `C-k` for easy navigation in anaconda-view-mode when multiple
   references are displayed. Doesn't conflict with normal `hjkl` navigation in
   other views of `anaconda-view-mode`

Fix #7538
Fix #5737
  • Loading branch information
nixmaniack authored and TheBB committed May 24, 2017
1 parent d28d9be commit 47cb3e0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
8 changes: 8 additions & 0 deletions layers/+lang/python/funcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,11 @@ to be called for each testrunner. "
(when (and python-sort-imports-on-save
(derived-mode-p 'python-mode))
(py-isort-before-save)))


;;* Anaconda
(defun spacemacs/anaconda-view-forward-and-push ()
"Find next button and hit RET"
(interactive)
(forward-button 1)
(call-interactively #'push-button))
11 changes: 9 additions & 2 deletions layers/+lang/python/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,15 @@
"ga" 'anaconda-mode-find-assignments
"gb" 'anaconda-mode-go-back
"gu" 'anaconda-mode-find-references)
(evilified-state-evilify anaconda-mode-view-mode anaconda-mode-view-mode-map
(kbd "q") 'quit-window)

(evilified-state-evilify-map anaconda-mode-view-mode-map
:mode anaconda-mode-view-mode
:bindings
(kbd "q") 'quit-window
(kbd "C-j") 'next-error-no-select
(kbd "C-k") 'previous-error-no-select
(kbd "RET") 'spacemacs/anaconda-view-forward-and-push)

(spacemacs|hide-lighter anaconda-mode)

(defadvice anaconda-mode-goto (before python/anaconda-mode-goto activate)
Expand Down

0 comments on commit 47cb3e0

Please sign in to comment.