Add Windows-specific settings for Ivy
This commit is contained in:
parent
b87f32a9a3
commit
7f0927f7ce
1 changed files with 17 additions and 1 deletions
18
oni-ivy.el
18
oni-ivy.el
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
;; Author: Tom Willemse <tom@ryuslash.org>
|
;; Author: Tom Willemse <tom@ryuslash.org>
|
||||||
;; Keywords: local
|
;; Keywords: local
|
||||||
;; Version: 20190228215753
|
;; Version: 20190228220438
|
||||||
;; Package-Requires: (ivy ivy-hydra diminish)
|
;; Package-Requires: (ivy ivy-hydra diminish)
|
||||||
|
|
||||||
;; This program is free software; you can redistribute it and/or modify
|
;; This program is free software; you can redistribute it and/or modify
|
||||||
|
@ -29,6 +29,22 @@
|
||||||
(require 'ivy)
|
(require 'ivy)
|
||||||
(require 'ivy-hydra)
|
(require 'ivy-hydra)
|
||||||
|
|
||||||
|
(defun oni-ivy--disable (orig-fun &rest args)
|
||||||
|
"Disable ivy while running ORIG-FUN with ARGS."
|
||||||
|
(let ((ivy-enabled ivy-mode))
|
||||||
|
(unwind-protect
|
||||||
|
(progn
|
||||||
|
(when ivy-enabled
|
||||||
|
(ivy-mode -1))
|
||||||
|
(apply orig-fun args))
|
||||||
|
(when ivy-enabled
|
||||||
|
(ivy-mode 1)))))
|
||||||
|
|
||||||
|
(when (eq system-type 'windows-nt)
|
||||||
|
(with-eval-after-load 'grep
|
||||||
|
(add-function :around (symbol-function 'grep-read-files)
|
||||||
|
#'oni-ivy--disable)))
|
||||||
|
|
||||||
(diminish 'ivy-mode)
|
(diminish 'ivy-mode)
|
||||||
|
|
||||||
;;;###autoload(with-eval-after-load 'ivy (require 'oni-ivy))
|
;;;###autoload(with-eval-after-load 'ivy (require 'oni-ivy))
|
||||||
|
|
Loading…
Reference in a new issue