Commit 1850913d authored by Dmitry Gutov's avatar Dmitry Gutov

* lisp/progmodes/ruby-mode.el (ruby-font-lock-keywords): Highlight

regexp options.

Fixes: debbugs:16914
parent 2907acd4
2014-03-01 Dmitry Gutov <dgutov@yandex.ru>
* progmodes/ruby-mode.el (ruby-font-lock-keywords): Highlight
regexp options. (Bug#16914)
2014-03-01 Martin Rudalics <rudalics@gmx.at>
* window.el (window--max-delta-1): Round down when calculating
......
......@@ -2132,6 +2132,16 @@ See `font-lock-syntax-table'.")
;; Character literals.
;; FIXME: Support longer escape sequences.
("\\_<\\?\\\\?\\S " 0 font-lock-string-face)
;; Regexp options.
("\\(?:\\s|\\|/\\)\\([imxo]+\\)"
1 (when (save-excursion
(let ((state (syntax-ppss (match-beginning 0))))
(and (nth 3 state)
(or (eq (char-after) ?/)
(progn
(goto-char (nth 8 state))
(looking-at "%r"))))))
font-lock-preprocessor-face))
)
"Additional expressions to highlight in Ruby mode.")
......
......@@ -29,6 +29,10 @@
# Highlight the regexp after "if".
x = toto / foo if /do bar/ =~ "dobar"
# Regexp options are highlighted.
/foo/xi != %r{bar}mo.tee
bar(class: XXX) do # ruby-indent-keyword-label
foo
end
......
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