summaryrefslogtreecommitdiff
path: root/lisp/progmodes/ruby-mode.el
diff options
context:
space:
mode:
authorDmitry Gutov <dgutov@yandex.ru>2021-02-02 03:47:46 +0200
committerDmitry Gutov <dgutov@yandex.ru>2021-02-02 03:48:04 +0200
commit83efac64779b0cda1a700d2f82d63a1afa1ac6f4 (patch)
tree623177e0425d79d1461951ca70155a16d5549352 /lisp/progmodes/ruby-mode.el
parente38e7b7bc121b96649518e5e986bba23697abc2d (diff)
downloademacs-83efac64779b0cda1a700d2f82d63a1afa1ac6f4.tar.gz
ruby-syntax-propertize: Fix certain cases following ::
* lisp/progmodes/ruby-mode.el (ruby-syntax-propertize): Make sure to backtrack if the "symbols with special characters" rule is aborted because of preceding colon.
Diffstat (limited to 'lisp/progmodes/ruby-mode.el')
-rw-r--r--lisp/progmodes/ruby-mode.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index a8667acb9d5..e7f407b6367 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -1869,8 +1869,8 @@ It will be properly highlighted even when the call omits parens.")
;; Symbols with special characters.
(":\\([-+~]@?\\|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|![~=]?\\|\\[\\]=?\\)"
(1 (unless (or
- (eq (char-before (match-beginning 0)) ?:)
- (nth 8 (syntax-ppss (match-beginning 1))))
+ (nth 8 (syntax-ppss (match-beginning 1)))
+ (eq (char-before (match-beginning 0)) ?:))
(goto-char (match-end 0))
(string-to-syntax "_"))))
;; Symbols ending with '=' (bug#42846).