(treesit-simple-indent-presets): Ensure 'and' works for anchors too
* lisp/treesit.el (treesit-simple-indent-presets): Rewrite to return the last successful evaluation, not just t.
This commit is contained in:
parent
ff66a5d324
commit
9d410f8de6
1 changed files with 6 additions and 4 deletions
|
@ -1179,10 +1179,12 @@ See `treesit-simple-indent-presets'.")
|
|||
;; TODO: Document.
|
||||
(cons 'and (lambda (&rest fns)
|
||||
(lambda (node parent bol &rest _)
|
||||
(not
|
||||
(seq-find
|
||||
(lambda (fn) (not (funcall fn node parent bol)))
|
||||
fns)))))
|
||||
(let (res)
|
||||
(catch 'break
|
||||
(dolist (fn fns)
|
||||
(setq res (funcall fn node parent bol))
|
||||
(unless res (throw 'break t))))
|
||||
res))))
|
||||
(cons 'or (lambda (&rest fns)
|
||||
(lambda (node parent bol &rest _)
|
||||
(seq-find
|
||||
|
|
Loading…
Add table
Reference in a new issue