]> git.eshelyaron.com Git - emacs.git/commitdiff
; Fix c-ts-common--prev-standalone-sibling
authorYuan Fu <casouri@gmail.com>
Fri, 14 Feb 2025 16:36:24 +0000 (08:36 -0800)
committerEshel Yaron <me@eshelyaron.com>
Sat, 15 Feb 2025 19:31:07 +0000 (20:31 +0100)
* lisp/progmodes/c-ts-common.el:
(c-ts-common--prev-standalone-sibling): Fix.

(cherry picked from commit ac9cf20919c46169a2e3aaa2b75ccb37dd5b5ff1)

lisp/progmodes/c-ts-common.el

index d81fcca622dce0cdc845c96ddde7c404290fdffe..79f5877ff16f87b65d03858797ba1330521bebf6 100644 (file)
@@ -631,10 +631,10 @@ for determining standlone line."
                              (if treesit-simple-indent-standalone-predicate
                                  (funcall
                                   treesit-simple-indent-standalone-predicate
-                                  parent)
+                                  node)
                                (c-ts-common--standalone-predicate parent)))))
-        (setq node (treesit-node-prev-sibling node 'named))))
-    (if (numberp anchor) anchor (treesit-node-start node))))
+        (setq node (treesit-node-prev-sibling node 'named)))
+      (if (numberp anchor) anchor (treesit-node-start node)))))
 
 (defun c-ts-common-parent-ignore-preproc (node)
   "Return the parent of NODE, skipping preproc nodes."