]> git.eshelyaron.com Git - emacs.git/commitdiff
; Minor simplification for tree-sitter indent preset column-0
authorYuan Fu <casouri@gmail.com>
Sat, 30 Nov 2024 04:39:00 +0000 (20:39 -0800)
committerEshel Yaron <me@eshelyaron.com>
Wed, 4 Dec 2024 17:02:56 +0000 (18:02 +0100)
* lisp/treesit.el (treesit-simple-indent-presets): Simplify.

(cherry picked from commit 4afdb7e80febd56f4024bad0aff4356198f6ce53)

lisp/treesit.el

index 1c57191fe53d4c5f70cefac1769700e95e232fae..628a8b3c766cab59ed9596971bdf0a20204fcb68 100644 (file)
@@ -1740,10 +1740,7 @@ OFFSET is the indent offset; if it doesn't match, return nil.")
                              (forward-line -1)
                              (skip-chars-forward " \t")
                              (point))))
-        (cons 'column-0 (lambda (_n _p bol &rest _)
-                          (save-excursion
-                            (goto-char bol)
-                            (line-beginning-position))))
+        (cons 'column-0 (lambda (&rest _) (pos-bol)))
         ;; TODO: Document.
         (cons 'and (lambda (&rest fns)
                      (lambda (node parent bol &rest _)