fix(tree-sitter): message raised when jumping up

as opposed to a nasty error,
the error was raised because I was not using the abs of count
this commit also comes with general code cleanup,
this includes
- removal of the eval quasiquote antipattern when an apply would work
better
- use of the :key keyword instead of the lambda
This commit is contained in:
Jeetaditya Chatterjee 2021-12-09 03:22:33 +00:00
parent 6127692848
commit 32bf2ee4cf
No known key found for this signature in database
GPG key ID: 09D54CECD2132B91

View file

@ -169,10 +169,8 @@ Targets `vimmish-fold', `hideshow', `ts-fold' and `outline' folds."
(eq (overlay-get ov 'creator) 'ts-fold))
;; `overlays-in' does not provide a list that is sorted
;; (in the way we need it atleast) so we need to sort it based on direction
(cl-sort (eval `(overlays-in ,@arg-list))
(lambda (ov1 ov2)
(funcall comp-fun (overlay-start ov1) (overlay-start ov2)))))))
(if (and ovs (<= count (length ovs)))
(cl-sort (apply #'overlays-in arg-list) comp-fun :key #'overlay-start))))
(if (and ovs (<= (abs count) (length ovs)))
(goto-char (overlay-start (nth (- (abs count) 1) ovs))))))))
if (save-excursion (funcall fn))
collect it into points