瀏覽代碼

Fix

master
10sr 4 年之前
父節點
當前提交
027ae0482e
簽署人: 10sr GPG Key ID: 7BEC428194130EB2
共有 1 個文件被更改,包括 13 次插入9 次删除
  1. +13
    -9
      emacs.el

+ 13
- 9
emacs.el 查看文件

@@ -1155,15 +1155,19 @@ THEM are function and its args."
(error "rg not found"))
(fuzzy-finder :input-command "rg -nH --no-heading --hidden --follow --glob '!.git/*' --color=always ^"
:action (lambda (results)
(let ((results (mapcar (lambda (result)
(let* ((fields (split-string result ":"))
(file (pop fields))
(linenumber (pop fields)))
(list :file file
:linenumber linenumber)))
results)))
(dolist (result results)
(let* ((fields (split-string result ":"))
(file (pop fields))
(linenumber (pop fields)))
(find-file (expand-file-name file))
(when linenumber
(goto-char (point-min))
(forward-line (- (string-to-number linenumber) 1))
(back-to-indentation)))))))
(find-file (plist-get result :file))
(when (plist-get result :linenumber)
(goto-char (point-min))
(forward-line (- (string-to-number (plist-get result :linenumber)) 1))
(back-to-indentation)))))))
(define-key ctl-x-map "S" 'my-fuzzy-finder-ripgrep-lines)

(defun my-fuzzy-finder-dired ()
@@ -2952,7 +2956,7 @@ Any output will be written to current buffer."
(require 'counsel nil t)
(when (require 'ivy-prescient nil t)
(set-variable 'prescient-filter-method
'(fuzzy literal regexp initialism))
'(literal regexp initialism fuzzy prefix))
(ivy-prescient-mode 1)))




Loading…
取消
儲存