Commit 56cd894e authored by Adam Sokolnicki's avatar Adam Sokolnicki Committed by Dmitry Gutov
Browse files

* lisp/progmodes/ruby-mode.el (ruby-toggle-block): Don't stop at

interpolation curlies.

Fixes: debbugs:15914
parent 96e78d1f
2013-11-17 Adam Sokolnicki <adam.sokolnicki@gmail.com> (tiny change)
* progmodes/ruby-mode.el (ruby-toggle-block): Don't stop at
interpolation curlies (Bug#15914).
2013-11-17 Jay Belanger <jay.p.belanger@gmail.com>
* calc/calc.el (calc-context-sensitive-enter): New variable.
......
......@@ -1590,8 +1590,9 @@ If the result is do-end block, it will always be multiline."
(let ((start (point)) beg end)
(end-of-line)
(unless
(if (and (re-search-backward "\\({\\)\\|\\_<do\\(\\s \\|$\\||\\)")
(if (and (re-search-backward "\\(?:[^#]\\)\\({\\)\\|\\(\\_<do\\_>\\)")
(progn
(goto-char (or (match-beginning 1) (match-beginning 2)))
(setq beg (point))
(save-match-data (ruby-forward-sexp))
(setq end (point))
......
......@@ -309,6 +309,12 @@ VALUES-PLIST is a list with alternating index and value elements."
(ruby-toggle-block)
(should (string= "foo do |b|\n b + 1\nend" (buffer-string)))))
(ert-deftest ruby-toggle-block-with-interpolation ()
(ruby-with-temp-buffer "foo do\n \"#{bar}\"\nend"
(beginning-of-line)
(ruby-toggle-block)
(should (string= "foo { \"#{bar}\" }" (buffer-string)))))
(ert-deftest ruby-recognize-symbols-starting-with-at-character ()
(ruby-assert-face ":@abc" 3 font-lock-constant-face))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment