[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-29 da2e440462b 1/2: ruby-ts-mode: Fix an out-of-bounds error with
From: |
Dmitry Gutov |
Subject: |
emacs-29 da2e440462b 1/2: ruby-ts-mode: Fix an out-of-bounds error with heredoc at eob |
Date: |
Sat, 23 Dec 2023 21:07:35 -0500 (EST) |
branch: emacs-29
commit da2e440462b643427de94433f5e8d0e1330c7450
Author: Dmitry Gutov <dmitry@gutov.dev>
Commit: Dmitry Gutov <dmitry@gutov.dev>
ruby-ts-mode: Fix an out-of-bounds error with heredoc at eob
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--syntax-propertize):
Fix an out-of-bounds error with heredoc at eob.
---
lisp/progmodes/ruby-ts-mode.el | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el
index a30131aad89..843f468e2a1 100644
--- a/lisp/progmodes/ruby-ts-mode.el
+++ b/lisp/progmodes/ruby-ts-mode.el
@@ -1063,8 +1063,9 @@ leading double colon is not added."
('heredoc
(put-text-property (treesit-node-start node) (1+ (treesit-node-start
node))
'syntax-table (string-to-syntax "\""))
- (put-text-property (treesit-node-end node) (1+ (treesit-node-end
node))
- 'syntax-table (string-to-syntax "\"")))
+ (when (< (treesit-node-end node) (point-max))
+ (put-text-property (treesit-node-end node) (1+ (treesit-node-end
node))
+ 'syntax-table (string-to-syntax "\""))))
('percent
;; FIXME: Put the first one on the first paren in both %Q{} and %().
;; That would stop electric-pair-mode from pairing, though. Hmm.