Commit f178c32d authored by Dmitry Gutov's avatar Dmitry Gutov
Browse files

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

font-lock the beginning of singleton class as heredoc.

* test/automated/ruby-mode-tests.el (ruby-heredoc-font-lock)
(ruby-singleton-class-no-heredoc-font-lock): New tests.
parent 413d4689
......@@ -14,6 +14,11 @@
(advice-add): Use them.
(advice-member-p): Correctly handle macros.
2012-11-13 Dmitry Gutov <dgutov@yandex.ru>
* progmodes/ruby-mode.el (ruby-font-lock-keywords): Never
font-lock the beginning of singleton class as heredoc.
2012-11-13 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/gv.el (gv-define-simple-setter): One more fix (bug#12871).
......
......@@ -1551,7 +1551,8 @@ See `font-lock-syntax-table'.")
ruby-keyword-end-re)
2)
;; here-doc beginnings
(list ruby-here-doc-beg-re 0 'font-lock-string-face)
`(,ruby-here-doc-beg-re 0 (unless (ruby-singleton-class-p (match-beginning 0))
'font-lock-string-face))
;; variables
'("\\(^\\|[^_:.@$]\\|\\.\\.\\)\\b\\(nil\\|self\\|true\\|false\\)\\>"
2 font-lock-variable-name-face)
......
2012-11-13 Dmitry Gutov <dgutov@yandex.ru>
* automated/ruby-mode-tests.el (ruby-heredoc-font-lock)
(ruby-singleton-class-no-heredoc-font-lock): New tests.
2012-11-12 Stefan Monnier <monnier@iro.umontreal.ca>
* automated/advice-tests.el: New tests.
......
......@@ -76,6 +76,14 @@ VALUES-PLIST is a list with alternating index and value elements."
(ruby-assert-state "foo <<asd\n" 3 ?\n)
(ruby-assert-state "class <<asd\n" 3 nil))
(ert-deftest ruby-heredoc-font-lock ()
(let ((s "foo <<eos.gsub('^ *', '')"))
(ruby-assert-face s 9 'font-lock-string-face)
(ruby-assert-face s 10 nil)))
(ert-deftest ruby-singleton-class-no-heredoc-font-lock ()
(ruby-assert-face "class<<a" 8 nil))
(ert-deftest ruby-deep-indent ()
(let ((ruby-deep-arglist nil)
(ruby-deep-indent-paren '(?\( ?\{ ?\[ ?\] t)))
......
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