;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\305\306\307\310\311\302\312\313&\210\314\315\316\317\320DD\321\322\323\311\306&\210\314\324\316\317\325DD\326\322\327\311\306&\207" [require inline ivy fuz fuz-extra custom-declare-group ivy-fuz nil "Sort `ivy' candidates by fuz" :group :prefix "ivy-fuz-" custom-declare-variable ivy-fuz-sorting-method funcall function #[0 "\300\207" [skim] 1] "The fuzzy sorting method in use.\n\nThe value should be `skim' or `clangd', skim's scoring function is a little\nslower but return better result than clangd's." :type (choice (const :tag "Skim" skim) (const :tag "Clangd" clangd)) ivy-fuz-sort-limit #[0 "\300\207" [5000] 1] "The limitaition for fuzzy sorting.\n\nSet to nil will sort all matched candidates." (choice (const :tag "Unlimited" nil) integer)] 8) (defvar ivy-fuz--score-cache (make-hash-table :test 'equal)) #@67 Calc the fuzzy match score of STR with PATTERN. (fn PATTERN STR) (defalias 'ivy-fuz--fuzzy-score #[514 "\302\267\202\303\"\202\304\"\202\305\306\"\262\206 \207" [ivy-fuz-sorting-method most-negative-fixnum #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (clangd 6 skim 13)) fuz-calc-score-clangd fuz-calc-score-skim error "No clause matching `%S'"] 6 (#$ . 971)]) (byte-code "\300\301\302\303#\300\207" [function-put ivy-fuz--fuzzy-score compiler-macro ivy-fuz--fuzzy-score--inliner] 4) #@33 (fn INLINE--FORM PATTERN STR) (defalias 'ivy-fuz--fuzzy-score--inliner #[771 "\3002\301\302\303\304\305D\306ED\304\307D\310EDF\311E0\207" [inline--just-use or pcase-exhaustive ivy-fuz-sorting-method \` clangd fuz-calc-score-clangd skim fuz-calc-score-skim most-negative-fixnum] 11 (#$ . 1518)]) #@83 Return all char positions where STR fuzzy matched with PATTERN. (fn PATTERN STR) (defalias 'ivy-fuz--fuzzy-indices #[514 "\301\267\202\302\"\207\303\"\207\304\305\"\207" [ivy-fuz-sorting-method #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (clangd 6 skim 11)) fuz-find-indices-clangd fuz-find-indices-skim error "No clause matching `%S'"] 6 (#$ . 1831)]) (byte-code "\300\301\302\303#\300\207" [function-put ivy-fuz--fuzzy-indices compiler-macro ivy-fuz--fuzzy-indices--inliner] 4) #@33 (fn INLINE--FORM PATTERN STR) (defalias 'ivy-fuz--fuzzy-indices--inliner #[771 "\3002\301\302\303\304D\305ED\303\306D\307EDF0\207" [inline--just-use pcase-exhaustive ivy-fuz-sorting-method \` clangd fuz-find-indices-clangd skim fuz-find-indices-skim] 10 (#$ . 2368)]) #@73 Return (LENGTH SCORE) by matching CAND with PATTERN. (fn PATTERN CAND) (defalias 'ivy-fuz--get-score-data #[514 "\211G\230\203\f\211D\207\211 \303\267\202!\304\"\202(\305\"\202( \306\307\"\262\206,\nD\207" [most-positive-fixnum ivy-fuz-sorting-method most-negative-fixnum #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (clangd 19 skim 26)) fuz-calc-score-clangd fuz-calc-score-skim error "No clause matching `%S'"] 8 (#$ . 2652)]) (defalias 'ivy-fuz-regex-fuzzy 'ivy--regex-fuzzy) #@54 Sort CANDS according to PATTERN. (fn PATTERN CANDS) (defalias 'ivy-fuz-sort-fn #[514 "\3021_\303\304\"\211\203\305\306O\202\307\310\311\"\312#\313\306\203EW\203E@!A@ V\203\211A\262\242B\262T\262\202\314\315\"\262\316\314\310\317#\"\262\244\266\2050\207\210\207" [ivy-fuz-sort-limit most-negative-fixnum (error) string-prefix-p "^" 1 nil fuz-memo-function make-closure #[257 "\301\300\"\207" [V0 ivy-fuz--get-score-data] 4 "\n\n(fn CAND)"] equal 0 sort #[514 "GGW\207" #1=[] 4 "\n\n(fn E1 E2)"] #[514 "\242\243\211\242\243\242\243\211\242\243U\203\"W\207V\207" #1# 16 "\n\n(fn ARG0 ARG1)"] #[514 "\301\300!\300!\"\207" [V0 V1] 6 "\n\n(fn E1 E2)"]] 14 (#$ . 3192)]) #@63 Put highlight face on matched positions of the STR. (fn STR) (defalias 'ivy-fuz-highlight-fn #[257 "\302\303\" \304\267\202\305\"\202\306\"\202 \307\310\"\262\311\312\211\203I\211@\211TU\2043T\262\211\262\313\211T\314!\n$\210A\266\202\202\"\210\207" [ivy-text ivy-fuz-sorting-method ivy--remove-prefix "^" #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (clangd 10 skim 17)) fuz-find-indices-clangd fuz-find-indices-skim error "No clause matching `%S'" 0 -2 ivy-add-face-text-property ivy--minibuffer-face] 12 (#$ . 3928)]) (provide 'ivy-fuz)