aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Sokolnicki2013-11-17 23:39:13 +0200
committerDmitry Gutov2013-11-17 23:39:13 +0200
commit56cd894e90949294d9578fd9fa45a179389f3306 (patch)
tree913c0ec7226d4df5d5acfa67a18313b0ab682e3a
parent96e78d1fb3fd5543c513d5a949c5d52654b6006a (diff)
downloademacs-56cd894e90949294d9578fd9fa45a179389f3306.tar.gz
emacs-56cd894e90949294d9578fd9fa45a179389f3306.zip
* lisp/progmodes/ruby-mode.el (ruby-toggle-block): Don't stop at
interpolation curlies. Fixes: debbugs:15914
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/progmodes/ruby-mode.el3
-rw-r--r--test/automated/ruby-mode-tests.el6
3 files changed, 13 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index faa2243ca3b..7017e3ffb49 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12013-11-17 Adam Sokolnicki <adam.sokolnicki@gmail.com> (tiny change)
2
3 * progmodes/ruby-mode.el (ruby-toggle-block): Don't stop at
4 interpolation curlies (Bug#15914).
5
12013-11-17 Jay Belanger <jay.p.belanger@gmail.com> 62013-11-17 Jay Belanger <jay.p.belanger@gmail.com>
2 7
3 * calc/calc.el (calc-context-sensitive-enter): New variable. 8 * calc/calc.el (calc-context-sensitive-enter): New variable.
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index ab9fdce6af8..28c44307ff2 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -1590,8 +1590,9 @@ If the result is do-end block, it will always be multiline."
1590 (let ((start (point)) beg end) 1590 (let ((start (point)) beg end)
1591 (end-of-line) 1591 (end-of-line)
1592 (unless 1592 (unless
1593 (if (and (re-search-backward "\\({\\)\\|\\_<do\\(\\s \\|$\\||\\)") 1593 (if (and (re-search-backward "\\(?:[^#]\\)\\({\\)\\|\\(\\_<do\\_>\\)")
1594 (progn 1594 (progn
1595 (goto-char (or (match-beginning 1) (match-beginning 2)))
1595 (setq beg (point)) 1596 (setq beg (point))
1596 (save-match-data (ruby-forward-sexp)) 1597 (save-match-data (ruby-forward-sexp))
1597 (setq end (point)) 1598 (setq end (point))
diff --git a/test/automated/ruby-mode-tests.el b/test/automated/ruby-mode-tests.el
index d5d262590b6..e84f55be93d 100644
--- a/test/automated/ruby-mode-tests.el
+++ b/test/automated/ruby-mode-tests.el
@@ -309,6 +309,12 @@ VALUES-PLIST is a list with alternating index and value elements."
309 (ruby-toggle-block) 309 (ruby-toggle-block)
310 (should (string= "foo do |b|\n b + 1\nend" (buffer-string))))) 310 (should (string= "foo do |b|\n b + 1\nend" (buffer-string)))))
311 311
312(ert-deftest ruby-toggle-block-with-interpolation ()
313 (ruby-with-temp-buffer "foo do\n \"#{bar}\"\nend"
314 (beginning-of-line)
315 (ruby-toggle-block)
316 (should (string= "foo { \"#{bar}\" }" (buffer-string)))))
317
312(ert-deftest ruby-recognize-symbols-starting-with-at-character () 318(ert-deftest ruby-recognize-symbols-starting-with-at-character ()
313 (ruby-assert-face ":@abc" 3 font-lock-constant-face)) 319 (ruby-assert-face ":@abc" 3 font-lock-constant-face))
314 320