diff options
| author | Dmitry Gutov | 2015-11-15 07:25:19 +0200 |
|---|---|---|
| committer | Dmitry Gutov | 2015-11-15 07:25:19 +0200 |
| commit | 3a1a220b02fa5627718380b2bd0a04800db098fb (patch) | |
| tree | f2331dfb1ab0d99c6be1a9e66d3fedd79cf02998 | |
| parent | a4c6f55b9a222849a1c5d590589b1f8f0627d6f8 (diff) | |
| download | emacs-3a1a220b02fa5627718380b2bd0a04800db098fb.tar.gz emacs-3a1a220b02fa5627718380b2bd0a04800db098fb.zip | |
Improve Ruby 1.9-style keyword keys highlighting
* lisp/progmodes/ruby-mode.el (ruby-font-lock-keywords):
Handle required keyword arguments (bug#21367).
And highlight the colon together with the name.
| -rw-r--r-- | lisp/progmodes/ruby-mode.el | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 09338860c75..754785168f2 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el | |||
| @@ -2193,8 +2193,9 @@ See `font-lock-syntax-table'.") | |||
| 2193 | ;; Constants. | 2193 | ;; Constants. |
| 2194 | ("\\(?:\\_<\\|::\\)\\([A-Z]+\\(\\w\\|_\\)*\\)" | 2194 | ("\\(?:\\_<\\|::\\)\\([A-Z]+\\(\\w\\|_\\)*\\)" |
| 2195 | 1 (unless (eq ?\( (char-after)) font-lock-type-face)) | 2195 | 1 (unless (eq ?\( (char-after)) font-lock-type-face)) |
| 2196 | ("\\(^\\s *\\|[[{(,]\\s *\\|\\sw\\s +\\)\\(\\(\\sw\\|_\\)+\\):[^:]" | 2196 | ;; Ruby 1.9-style symbol hash keys. |
| 2197 | (2 font-lock-constant-face)) | 2197 | ("\\(?:^\\s *\\|[[{(,]\\s *\\|\\sw\\s +\\)\\(\\(\\sw\\|_\\)+:\\)[^:]" |
| 2198 | (1 (progn (forward-char -1) font-lock-constant-face))) | ||
| 2198 | ;; Conversion methods on Kernel. | 2199 | ;; Conversion methods on Kernel. |
| 2199 | (,(concat ruby-font-lock-keyword-beg-re | 2200 | (,(concat ruby-font-lock-keyword-beg-re |
| 2200 | (regexp-opt '("Array" "Complex" "Float" "Hash" | 2201 | (regexp-opt '("Array" "Complex" "Float" "Hash" |