interpolation curlies.
Fixes: debbugs:15914
+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.
(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))
(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))