On Wednesday, November 23rd, 2022 at 05:53, Eason Huang wrote: > > > But when I try to indent code, > it will raise the error (Wrong type argument: stringp, nil) again. > It should be a different bug. > > Steps to reproduce: > > After the step 4, try to type the code as below: > > int main(){ > <-- put you cursor at the first colum 1, and then hit TAB(indent-for-tab-command) > > } > > after you hit TAB at the above code, you will get the backtrace error as > below: > > Debugger entered--Lisp error: (wrong-type-argument stringp nil) > looking-at(nil t) > #f(compiled-function (&rest _) #)(nil # 13) > > #f(compiled-function (fn) #)(#f(compiled-function (&rest _) #)) > > mapcar(#f(compiled-function (fn) #) (#f(compiled-function (n parent &rest _) #) #f(compiled-function (&rest _) #))) > > #f(compiled-function (node parent bol &rest _) #)(nil # 13) > > treesit--simple-indent-eval(((and (parent-is "comment") comment-end) nil # 13)) > > treesit-simple-indent(nil # 13) > > treesit--indent-1() > treesit-indent() > indent-according-to-mode() > electric-indent-post-self-insert-function() > newline(nil 1) > funcall-interactively(newline nil 1) > command-execute(newline) > > > -- > Eason Huang > The attached patch fixes it for me.