(paragraph-inline)))
(setq-local treesit-simple-imenu-settings
- `(("Headings"
- markdown-ts-imenu-node-p nil markdown-ts-imenu-name-function)))
+ `(("Headings" markdown-ts-imenu-node-p nil markdown-ts-imenu-name-function)))
+ (setq-local treesit-outline-predicate "section")
(when (treesit-ready-p 'markdown)
(treesit-parser-create 'markdown-inline)
(if backward (seq-max bounds) (seq-min bounds)))))
closest))
-(defun treesit-outline-search (&optional bound move backward looking-at)
+(defun treesit-outline-search (&optional bound move backward looking-at recursive)
"Search for the next outline heading in the syntax tree.
For BOUND, MOVE, BACKWARD, LOOKING-AT, see the descriptions in
`outline-search-function'."
(if (bobp) (point) (1- (point)))
(pos-eol))))
(pred (if treesit-aggregated-outline-predicate
- (alist-get (treesit-language-at pos)
+ (alist-get (treesit-language-at (or bob-pos pos))
treesit-aggregated-outline-predicate)
treesit-outline-predicate))
(found (or bob-pos
(closest (treesit-closest-parser-boundary pos backward)))
;; Handle multi-language modes
- (if (and closest
+ (if (and closest (not recursive)
(or
;; Possibly was inside the local parser, and when can't find
;; more matches inside it then need to go over the closest
(goto-char (if backward
(max (point-min) (1- closest))
(min (point-max) (1+ closest))))
- (treesit-outline-search bound move backward))
+ (treesit-outline-search bound move backward nil 'recursive))
(if found
(if (or (not bound) (if backward (>= found bound) (<= found bound)))