diff options
author | Dmitry Gutov <dgutov@yandex.ru> | 2021-02-02 03:47:46 +0200 |
---|---|---|
committer | Dmitry Gutov <dgutov@yandex.ru> | 2021-02-02 03:48:04 +0200 |
commit | 83efac64779b0cda1a700d2f82d63a1afa1ac6f4 (patch) | |
tree | 623177e0425d79d1461951ca70155a16d5549352 /lisp | |
parent | e38e7b7bc121b96649518e5e986bba23697abc2d (diff) | |
download | emacs-83efac64779b0cda1a700d2f82d63a1afa1ac6f4.tar.gz emacs-83efac64779b0cda1a700d2f82d63a1afa1ac6f4.tar.bz2 emacs-83efac64779b0cda1a700d2f82d63a1afa1ac6f4.zip |
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')
-rw-r--r-- | lisp/progmodes/ruby-mode.el | 4 |
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). |