From a5d1f94fec6543cbf3c6e29f034c7ed53138c677 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 20 Mar 2015 06:04:36 +0200 Subject: [PATCH] Backport: ruby-mode: Expect regexp after { or | too Fixes: debbugs:20026 * progmodes/ruby-mode.el (ruby-syntax-before-regexp-re): Expect beginning of regexp also after open brace or vertical bar. (cherry picked from commit dad0fc589c18dd95cf1ac77869a4530e2848c328) --- lisp/ChangeLog | 6 ++++++ lisp/progmodes/ruby-mode.el | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 763a8eecfbd..0b568929b22 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2015-03-20 Nobuyoshi Nakada + + * progmodes/ruby-mode.el (ruby-syntax-before-regexp-re): Expect + beginning of regexp also after open brace or vertical bar. + (Bug#20026) + 2015-03-07 Michael Albinus * net/tramp.el (tramp-ssh-controlmaster-options): Make it a diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 3f560b9fee6..9c311cdbfb6 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -1777,7 +1777,7 @@ It will be properly highlighted even when the call omits parens.") (defvar ruby-syntax-before-regexp-re (concat ;; Special tokens that can't be followed by a division operator. - "\\(^\\|[[=(,~;<>]" + "\\(^\\|[[{|=(,~;<>]" ;; Distinguish ternary operator tokens. ;; FIXME: They don't really have to be separated with spaces. "\\|[?:] " -- 2.39.2