Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
1850913d
Commit
1850913d
authored
Mar 02, 2014
by
Dmitry Gutov
Browse files
* lisp/progmodes/ruby-mode.el (ruby-font-lock-keywords): Highlight
regexp options. Fixes: debbugs:16914
parent
2907acd4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
0 deletions
+19
-0
lisp/ChangeLog
lisp/ChangeLog
+5
-0
lisp/progmodes/ruby-mode.el
lisp/progmodes/ruby-mode.el
+10
-0
test/indent/ruby.rb
test/indent/ruby.rb
+4
-0
No files found.
lisp/ChangeLog
View file @
1850913d
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
...
...
lisp/progmodes/ruby-mode.el
View file @
1850913d
...
...
@@ -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."
)
...
...
test/indent/ruby.rb
View file @
1850913d
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment