;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\300\305!\210\306\307\310\311\312\313\314\315\316\317& \210\320\321\322\323\324DD\325\326\327\314\307&\210\320\330\322\323\331DD\332\326\327\314\307&\210\320\333\322\323\334DD\335\326\327\314\307&\210\320\336\322\323\337DD\340\326\341\314\307&\207" [require cl-lib f s subr-x ivy custom-declare-group ivy-file-preview nil "Preview the current ivy file selection." :prefix "ivy-file-preview-" :group tool :link (url-link :tag "Repository" "https://github.com/jcs-elpa/ivy-file-preview") custom-declare-variable ivy-file-preview-preview-only funcall function #[0 "\300\207" [t] 1] "Preview the file instead of actually opens the file." :type boolean ivy-file-preview-details #[0 "\300\207" [t] 1] "Preview file only when there are more details in the selection." ivy-file-preview-overlay-p #[0 "\300\207" [t] 1] "Show overlays while previewing." ivy-file-preview-overlay-delay-time #[0 "\300\207" [0.4] 1] "Time to delay before display overlays." float] 10) #@69 Files that are previewing, and will be closed after action is done. (defvar ivy-file-preview--preview-files nil (#$ . 1111)) #@40 Record down the current selected file. (defvar ivy-file-preview--selected-file "" (#$ . 1242)) #@51 Record windows status for when canceling command. (defvar ivy-file-preview--window-status nil (#$ . 1343)) #@19 List of overlays. (defvar ivy-file-preview--overlays nil (#$ . 1456)) #@43 Record down the current selected overlay. (defvar ivy-file-preview--current-overlay nil (#$ . 1532)) #@66 Record down the ivy text to prevent make overlay if not need to. (defvar ivy-file-preview--ivy-text "" (#$ . 1639)) #@35 Timer to make overlays in buffer. (defvar ivy-file-preview--overlay-timer nil (#$ . 1761)) #@101 Record the current present directory. It could either by `project-directory' or `default-directory' (defvar ivy-file-preview--current-dir "" (#$ . 1859)) #@50 Record of this command when entering minibuffer. (defvar ivy-file-preview--this-command nil (#$ . 2019)) #@36 Record of first candidate's index. (defvar ivy-file-preview--first-cand-index nil (#$ . 2130)) #@59 Return non-nil if current command is from `ivy-searcher'. (defalias 'ivy-file-preview--ivy-searcher-p #[0 "\301>\207" [ivy-file-preview--this-command (ivy-searcher-search-file ivy-searcher-search-project)] 2 (#$ . 2231)]) #@27 Initialize overlays data. (defalias 'ivy-file-preview--init-ov-data #[0 "\302 \205 \303\304\305\306$\211\207" [ivy-searcher--candidates ivy-file-preview--first-cand-index ivy-file-preview--ivy-searcher-p cl-position nil :test #[514 "\211A\262\301\302\"\230\207" [ivy-file-preview--selected-file plist-get :file] 6 "\n\n(fn KEY CAND)"]] 5 (#$ . 2460)]) #@245 Get matching end by currently selected candidate. An optional argument POS is use to calculate the position that relative to the length of `ivy-text'. An optional argument INDEX is use to find current ivy candidate. (fn &optional POS INDEX) (defalias 'ivy-file-preview--match-end #[512 "\204`\262\211\203\203\211\\\262\202 \262\304 \2031\211\n8\211A\305\306\"\211\2060 G\\\207 G\\\207" [ivy-file-preview--first-cand-index ivy--index ivy-searcher--candidates ivy-text ivy-file-preview--ivy-searcher-p plist-get :end] 7 (#$ . 2825)]) #@27 Get current project path. (defalias 'ivy-file-preview--project-path #[0 "\300 A\207" [project-current] 1 (#$ . 3385)]) #@41 Resolve FN for full file path. (fn FN) (defalias 'ivy-file-preview--get-file-path #[257 "\302 \303\304\305\306#)\266\203\203\211\303\304\305\306#)\266\203\203-\211\203-\307\"\207\307 \"\207" [inhibit-changing-match-data ivy-file-preview--current-dir ivy-file-preview--project-path "/" nil t string-match f-join] 9 (#$ . 3510)]) #@31 Goto LN line number. (fn LN) (defalias 'ivy-file-preview--goto-line #[257 "eb\210\211Sy\207" [] 2 (#$ . 3863)]) #@28 Kill TMR safely. (fn TMR) (defalias 'ivy-file-preview--safe-kill-timer #[257 "\300!\205 \301!\207" [timerp cancel-timer] 3 (#$ . 3982)]) #@52 Convert LN and COL to position point. (fn LN COL) (defalias 'ivy-file-preview--convert-pos-delta #[514 "\212y\210`\\)\207" [] 4 (#$ . 4129)]) #@156 Make a new overlay with BEG, END and face (FC). If CURRENT-OV is non-nil it create overlay that are currently selected. (fn BEG END &optional CURRENT-OV) (defalias 'ivy-file-preview--make-overlay #[770 "\301\"\302\303\203\304\202\305#\210\302\306\203\307\202\310#\210\211B\207" [ivy-file-preview--overlays make-overlay overlay-put face ivy-current-match ivy-minibuffer-match-highlight priority 100 0] 8 (#$ . 4281)]) #@73 Make current selected overlay with BEG and END. (fn &optional BEG END) (defalias 'ivy-file-preview--make-current-overlay #[512 "\204`\262\211\204G\\\262\302\303#\211\207" [ivy-text ivy-file-preview--current-overlay ivy-file-preview--make-overlay t] 6 (#$ . 4721)]) #@30 Delete all overlays in list. (defalias 'ivy-file-preview--delete-overlays #[0 "\303!\210 \211\203\211@\304!\210A\266\202\202\210\305\211\211\207" [ivy-file-preview--overlay-timer ivy-file-preview--overlays ivy-file-preview--current-overlay ivy-file-preview--safe-kill-timer delete-overlay nil] 5 (#$ . 5005)]) #@53 Set property list with PROP and VAL. (fn PROP VAL) (defalias 'ivy-file-preview--put-window-plist #[514 "\301#\211\207" [ivy-file-preview--window-status plist-put] 6 (#$ . 5330)]) #@32 Return current ivy candidates. (defalias 'ivy-file-preview--candidates #[0 "\206 \207" [ivy--old-cands ivy--all-candidates] 1 (#$ . 5520)]) #@61 Return nil if there is no candidate in current ivy session. (defalias 'ivy-file-preview--no-candidates-p #[0 "\300\301 GY\207" [0 ivy-file-preview--candidates] 2 (#$ . 5669)]) #@55 Extract the overlay data from current ivy candidates. (defalias 'ivy-file-preview--extract-candidates-overlay-data #[0 "\302 \210\303\304 #\305 \211G\306\211\211\211\211\211\211\211\307\204d\211\nW\203d\211 8\262 \310 !\262@\262\f\230\203UA@\262\3118\262\312\313FB\262\314\262\202]\203]\314\262\211T\262\202\315!\207" [ivy-file-preview--current-dir ivy-file-preview--selected-file ivy-file-preview--init-ov-data s-replace "" ivy-file-preview--candidates nil 0 ivy-file-preview--read-selection 2 :line-number :column t reverse] 16 (#$ . 5851)]) #@78 Delete the previous selected overlay and swap with current selected overlay. (defalias 'ivy-file-preview--swap-current-overlay #[0 "`\301!\302#\207" [ivy-file-preview--current-overlay ivy-file-preview--match-end move-overlay] 6 (#$ . 6437)]) #@45 Make overlays through out the whole buffer. (defalias 'ivy-file-preview--make-overlays #[0 "\300 \301\302\211\211\211\211\303 \302\211\205o\211@\304\305\"\262\304\306\"\262\204*\262 \202K\307!\262\307!\262Z\262\310\"\262 \311  \"\262`U\262\312  \"\210\203c\313  \"\210 T\262\nA\266\202\202 \207" [ivy-file-preview--extract-candidates-overlay-data 0 nil line-number-at-pos plist-get :line-number :column string-to-number ivy-file-preview--convert-pos-delta ivy-file-preview--match-end ivy-file-preview--make-overlay ivy-file-preview--make-current-overlay] 14 (#$ . 6689)]) #@36 Seconds to delay display overlays. (defalias 'ivy-file-preview--delay-make-overlays #[0 "\301!r\302\303\"\216\304@\305\"\210\306 \210\307 *\207" [minibuffer-scroll-window internal--before-with-selected-window make-closure #[0 "\301\300!\207" [V0 internal--after-with-selected-window] 2] select-window norecord ivy-file-preview--delete-overlays ivy-file-preview--make-overlays] 4 (#$ . 7307)]) #@90 Open the file path (FN) and move to POS. If POS is nil then it won't moves. (fn FN POS) (defalias 'ivy-file-preview--open-file #[514 "\302\303!\304!\203\305!\210\2027 \204\306\262\2027\307!\204)\310!\2032\211\311!\210\2027\312\306\262\203n:\203P\313@!\210\314A!\210\315 \210\202n\250\203_Tb\210\315 \210\202n\204ieb\210\202n\316\317\"\210\207" [ivy-file-preview--selected-file ivy-file-preview-details t f-filename file-exists-p find-file nil find-buffer-visiting get-buffer switch-to-buffer "" ivy-file-preview--goto-line move-to-column recenter error "Invalid position details: %s"] 7 (#$ . 7709)]) #@249 Do file preview execution. FN is the file path. POS can either be one of the following type: * integer : Position in file. * cons cell : Contain two integer. (line-number & column) * nil : Just open it without moving the point. (fn FN POS) (defalias 'ivy-file-preview--do-preview #[514 "\306!r\307\310\"\216\311@\312\"\210\313 \203#\314!\204#\315 \203#\nB \230\204,\316 \210\317\"\262\f\205c \205c\211\205c\230\203Q\203Q\320 \210\202^\321!\210\322\313\323#\211\262*\207" [minibuffer-scroll-window ivy-file-preview-preview-only ivy-file-preview--preview-files ivy-file-preview--selected-file ivy-file-preview-overlay-p ivy-file-preview-details internal--before-with-selected-window make-closure #[0 "\301\300!\207" [V0 internal--after-with-selected-window] 2] select-window norecord nil find-buffer-visiting buffer-file-name ivy-file-preview--delete-overlays ivy-file-preview--open-file ivy-file-preview--swap-current-overlay ivy-file-preview--safe-kill-timer run-with-timer ivy-file-preview--delay-make-overlays ivy-file-preview--ivy-text ivy-text ivy-file-preview--current-overlay ivy-file-preview--overlay-timer ivy-file-preview-overlay-delay-time] 8 (#$ . 8355)]) #@78 Read SELECTION and return list of data (file, line, column). (fn SELECTION) (defalias 'ivy-file-preview--read-selection #[257 "\211C\301 \302C\302C\302\303\304\305$\"\306\242\307\242#\240\210\310\242\311\"\262\2031\242\2023\211@A@\3128E\207" [found buffer-list nil cl-some make-closure #[257 "\301\304!\240\210\302\305\306\307\301\242!\"\240\210\302\242\300\242\310\311\312#)\207" [V0 V1 V2 inhibit-changing-match-data buffer-name format "^%s" regexp-quote nil t string-match] 8 "\n\n(fn BUF)"] s-replace-regexp "" split-string ":" 2] 12 (#$ . 9573)]) #@42 Execution after selection. (fn &rest _) (defalias 'ivy-file-preview--after-select #[128 "\203 \211\303\230\262\204\304 \203\305 \210\306 \207\307 \n8\206!\303\310!\211@A@\3118\312\2035\2026\313\262\211\205m\3141G\315!0\202I\210\312\262\3161V\315!0\202X\210\312\262\317!\262\320\203kB\202l\"\207" [ivy-file-preview-details ivy-text ivy--index "" ivy-file-preview--no-candidates-p ivy-file-preview--delete-overlays ivy-file-preview--back-to-pos ivy-file-preview--candidates ivy-file-preview--read-selection 2 nil t (error) cl-parse-integer (error) ivy-file-preview--get-file-path ivy-file-preview--do-preview] 12 (#$ . 10157)]) #@28 Back to starting position. (defalias 'ivy-file-preview--back-to-pos #[0 "\302!r\303\304\"\216\305@\306\"\210\307\310 \311\"!\210\310 \312\"b*\207" [minibuffer-scroll-window ivy-file-preview--window-status internal--before-with-selected-window make-closure #[0 "\301\300!\207" [V0 internal--after-with-selected-window] 2] select-window norecord switch-to-buffer plist-get :file :position] 5 (#$ . 10826)]) #@50 Revert frame status if user cancel the commands. (defalias 'ivy-file-preview--cancel-revert #[0 "?\205\304\305\306\n\307\"!\210\310 \306\n\311\"\"\207" [ivy-exit ivy-file-preview--selected-file ivy-file-preview--window-status minibuffer-scroll-window "" switch-to-buffer plist-get :file set-window-point :window-point] 5 (#$ . 11240)]) #@35 Execution after minibuffer setup. (defalias 'ivy-file-preview--enter #[0 "\306 \307 !r\310\311\"\216\312@\313\"\210\314\315p\"\210\314\316\317 \"\210\314\320`\"*\207" [this-command ivy-file-preview--this-command ivy-file-preview--window-status default-directory ivy-file-preview--current-dir minibuffer-scroll-window nil internal--before-with-selected-window make-closure #[0 "\301\300!\207" [V0 internal--after-with-selected-window] 2] select-window norecord ivy-file-preview--put-window-plist :file :window-point window-point :position] 4 (#$ . 11586)]) #@36 Execution before minibuffer exits. (defalias 'ivy-file-preview--exit #[0 "\305 \210\306 \210\307!\210\211\203-\211@ \230\204&\3101%\311\312!!0\210\202&\210A\266\202\202 \210\313\211\313\314\211\211\207" [ivy-file-preview--preview-files ivy-file-preview--selected-file ivy-file-preview--ivy-text ivy-file-preview--current-dir ivy-file-preview--this-command ivy-file-preview--cancel-revert ivy-file-preview--delete-overlays delete-dups (error) kill-buffer f-filename "" nil] 6 (#$ . 12154)]) #@28 Enable `ivy-file-preview'. (defalias 'ivy-file-preview--enable #[0 "\300\301\302\"\210\300\303\304\"\210\305\306\307\310#\207" [add-hook minibuffer-setup-hook ivy-file-preview--enter minibuffer-exit-hook ivy-file-preview--exit advice-add ivy--exhibit :after ivy-file-preview--after-select] 4 (#$ . 12665)]) #@29 Disable `ivy-file-preview'. (defalias 'ivy-file-preview--disable #[0 "\300\301\302\"\210\300\303\304\"\210\305\306\307\"\207" [remove-hook minibuffer-setup-hook ivy-file-preview--enter minibuffer-exit-hook ivy-file-preview--exit advice-remove ivy--exhibit ivy-file-preview--after-select] 3 (#$ . 12978)]) (byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313\314\315\316\315& \207" [custom-declare-variable ivy-file-preview-mode funcall function #[0 "\300\207" [nil] 1] "Non-nil if Ivy-File-Preview mode is enabled.\nSee the `ivy-file-preview-mode' command\nfor a description of this minor mode.\nSetting this variable directly does not take effect;\neither customize it (see the info node `Easy Customization')\nor call the function `ivy-file-preview-mode'." :set custom-set-minor-mode :initialize custom-initialize-default :type boolean :require ivy-file-preview :group] 14) #@620 Minor mode 'ivy-file-preview-mode'. This is a minor mode. If called interactively, toggle the `Ivy-File-Preview mode' mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode. If called from Lisp, toggle the mode if ARG is `toggle'. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number. To check whether the minor mode is enabled in the current buffer, evaluate `(default-value 'ivy-file-preview-mode)'. The mode's hook is called both when the mode is enabled and when it is disabled. (fn &optional ARG) (defalias 'ivy-file-preview-mode #[256 "\302 \303\301\304=\203\305\301!?\202!\247\203 \306W\203 \307\202!\310\"\210\311\300!\2038\312\301\"\305\301!\2038\301B \203B\313 \210\202E\314 \210\315\316\305\301!\203Q\317\202R\320\"\210\321\322!\203z\323\301!\210\302 \203j\211\302 \232\203z\324\325\305\301!\203v\326\202w\327\330#\210\210\331 \210\305\301!\207" [global-minor-modes ivy-file-preview-mode current-message set-default toggle default-value 1 nil t boundp delq ivy-file-preview--enable ivy-file-preview--disable run-hooks ivy-file-preview-mode-hook ivy-file-preview-mode-on-hook ivy-file-preview-mode-off-hook called-interactively-p any customize-mark-as-set message "Ivy-File-Preview mode %sabled%s" "en" "dis" "" force-mode-line-update] 6 (#$ . 13871) (byte-code "\203\n\301!\202 \302C\207" [current-prefix-arg prefix-numeric-value toggle] 2)]) (defvar ivy-file-preview-mode-hook nil) (byte-code "\301\302N\204\f\303\301\302\304#\210\303\301\305\306#\210\303\301\307\310C#\210\311\312\310\313\300!\205#\310\211%\210\314\315!\207" [ivy-file-preview-mode-map ivy-file-preview-mode-hook variable-documentation put "Hook run after entering or leaving `ivy-file-preview-mode'.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" custom-type hook standard-value nil add-minor-mode ivy-file-preview-mode boundp provide ivy-file-preview] 6)