]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix treesit-default-defun-skipper (bug#66711)
authorYuan Fu <casouri@gmail.com>
Mon, 11 Dec 2023 01:40:39 +0000 (17:40 -0800)
committerEshel Yaron <me@eshelyaron.com>
Thu, 21 Dec 2023 20:51:24 +0000 (21:51 +0100)
* lisp/treesit.el:
(treesit-default-defun-skipper): Add bol to the rx pattern.

(cherry picked from commit d2c4b926ac20de6f7d9f3576b22272bc560bd0f7)

lisp/treesit.el

index e146e40020bbb22cdffb7e389b0bd819522f1dc2..c6b9d8ff4bc465ef527a4137660edbf03a54d32c 100644 (file)
@@ -2359,7 +2359,7 @@ the current line if the beginning of the defun is indented."
          (forward-line 1))
         ;; Moving backward, but there are some whitespace (and only
         ;; whitespace) between point and BOL: go back to BOL.
-        ((looking-back (rx (+ (or " " "\t")))
+        ((looking-back (rx bol (+ (or " " "\t")))
                        (line-beginning-position))
          (beginning-of-line))))