Browse Source

Fix

master
10sr 4 years ago
parent
commit
027ae0482e
Signed by: 10sr GPG Key ID: 7BEC428194130EB2
1 changed files with 13 additions and 9 deletions
  1. +13
    -9
      emacs.el

+ 13
- 9
emacs.el View File

@@ -1155,15 +1155,19 @@ THEM are function and its args."
(error "rg not found")) (error "rg not found"))
(fuzzy-finder :input-command "rg -nH --no-heading --hidden --follow --glob '!.git/*' --color=always ^" (fuzzy-finder :input-command "rg -nH --no-heading --hidden --follow --glob '!.git/*' --color=always ^"
:action (lambda (results) :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) (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) (define-key ctl-x-map "S" 'my-fuzzy-finder-ripgrep-lines)


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






Loading…
Cancel
Save