[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-29 cfb180329b 2/2: ruby-ts-mode: Don't reindent when "class" or "d
From: |
Dmitry Gutov |
Subject: |
emacs-29 cfb180329b 2/2: ruby-ts-mode: Don't reindent when "class" or "def" is under "ERROR" |
Date: |
Wed, 25 Jan 2023 10:22:51 -0500 (EST) |
branch: emacs-29
commit cfb180329b567d907c11fc9f2bd24728729ec689
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>
ruby-ts-mode: Don't reindent when "class" or "def" is under "ERROR"
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules):
Don't reindent when "class" or "def" is under "ERROR" (bug#61017).
---
lisp/progmodes/ruby-ts-mode.el | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el
index eff846f858..6021597817 100644
--- a/lisp/progmodes/ruby-ts-mode.el
+++ b/lisp/progmodes/ruby-ts-mode.el
@@ -566,6 +566,12 @@ a statement container is a node that matches
((n-p-gp nil nil "regex") no-indent 0)
((parent-is "regex") no-indent 0)
+ ;; Incomplete buffer state, better not reindent (bug#61017).
+ ((and (parent-is "ERROR")
+ (or (node-is ,ruby-ts--class-or-module-regex)
+ (node-is "\\`def\\'")))
+ no-indent 0)
+
;; if then else elseif notes:
;;
;; 1. The "then" starts at the end of the line that ends