Ruby debug highlighting: dynamic check
Move check into function, and add to local-vars hook instead of the mode hook. This makes the variable changeable at runtime and also as part of local vars.
This commit is contained in:
parent
26bb5912f0
commit
b1f1674109
|
@ -62,9 +62,11 @@ Called interactively it prompts for a directory."
|
|||
|
||||
|
||||
;; highlight debugger keywords
|
||||
(defun spacemacs/ruby-highlight-debugger-keywords ()
|
||||
|
||||
(defun spacemacs/ruby-maybe-highlight-debugger-keywords ()
|
||||
"Highlight break point lines."
|
||||
(interactive)
|
||||
(highlight-lines-matching-regexp "byebug")
|
||||
(highlight-lines-matching-regexp "binding.irb")
|
||||
(highlight-lines-matching-regexp "binding.pry"))
|
||||
(when ruby-highlight-debugger-keywords
|
||||
(highlight-lines-matching-regexp "byebug")
|
||||
(highlight-lines-matching-regexp "binding.irb")
|
||||
(highlight-lines-matching-regexp "binding.pry")))
|
||||
|
|
|
@ -213,10 +213,9 @@
|
|||
:init
|
||||
(progn
|
||||
(spacemacs/declare-prefix-for-mode 'ruby-mode "mt" "ruby/test")
|
||||
(when ruby-highlight-debugger-keywords
|
||||
(spacemacs/add-to-hooks 'spacemacs/ruby-highlight-debugger-keywords
|
||||
'(ruby-mode-hook
|
||||
enh-ruby-mode-hook))))
|
||||
(spacemacs/add-to-hooks
|
||||
'spacemacs/ruby-maybe-highlight-debugger-keywords
|
||||
'(ruby-mode-local-vars-hook enh-ruby-mode-local-vars-hook)))
|
||||
:config (spacemacs/set-leader-keys-for-major-mode 'ruby-mode
|
||||
"'" 'ruby-toggle-string-quotes
|
||||
"{" 'ruby-toggle-block)))
|
||||
|
|
Loading…
Reference in a new issue