;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\302\303\304\305\306DD\307\310\311\312\301&\210\302\313\304\305\314DD\315\310\311\312\301\316\317& \207" [require tree-sitter custom-declare-variable tree-sitter-save-excursion-try-hard funcall function #[0 "\300\207" [nil] 1] "Whether `tree-sitter-save-excursion' should try as hard as possible." :type boolean :group tree-sitter-save-excursion-pixelwise #[0 "\300\301\302\303#??\207" [require pixel-scroll nil :noerror] 4] "Whether `tree-sitter-save-excursion' should restore the location pixelwise." :set #[514 "\211\203\300\301\302\303#\204\304\305!\210\306\"\207" [require pixel-scroll nil :noerror user-error "Pixelwise location restoration requires `pixel-scroll'; you may need to upgrade Emacs" set-default] 6 "\n\n(fn SYMBOL VALUE)"]] 10) #@111 Center point on SCREEN-LINE, then optionally scroll to PIXEL-POSN-Y. (fn SCREEN-LINE &optional PIXEL-POSN-Y) (defalias 'tree-sitter--recenter #[513 "\300!\210\211\205\301 Z\211\302V\203\303!\202\304[!\262\207" [recenter pixel-posn-y-at-point 0 pixel-scroll-pixel-down pixel-scroll-pixel-up] 5 (#$ . 868)]) #@639 Save the current location within the syntax tree; execute BODY; restore it. If the original location cannot be restored due to the syntax tree changing too much, this macro behaves like `save-excursion', unless `tree-sitter-save-excursion-try-hard' is non-nil, in which case it tries to get as close as possible to the original location. After the location is restored, the buffer text is scrolled so that point stays at roughly the same vertical screen position. If `pixel-scroll' is available and `tree-sitter-save-excursion-pixelwise' is non-nil, pixelwise scrolling is used instead, to make this restoration exact. (fn &rest BODY) (defalias 'tree-sitter-save-excursion '(macro . #[128 "\302\303\304\305\306\307\310\205\f\311D\257\312\313B\314\315\316\317 \205\320BFEE\207" [tree-sitter-save-excursion-pixelwise tree-sitter-save-excursion-try-hard let* (p (point)) (old-node (tree-sitter-node-at-point)) (steps (tsc--node-steps old-node)) (delta (- p (tsc-node-start-position old-node))) (screen-line (- (count-screen-lines (window-start) p) 1)) pixel-posn-y (pixel-posn-y-at-point) unwind-protect save-excursion condition-case err (when-let ((node (tsc--node-from-steps tree-sitter-tree steps))) (goto-char (+ delta (tsc-node-start-position node))) (tree-sitter--recenter screen-line pixel-posn-y)) tsc--invalid-node-step ((goto-char (tsc-node-start-position (cadr err))) (tree-sitter--recenter screen-line pixel-posn-y))] 10 (#$ . 1193)])) (byte-code "\300\301\302\303#\304\305!\207" [function-put tree-sitter-save-excursion lisp-indent-function 0 provide tree-sitter-extras] 4)