Skip to content

Commit

Permalink
fix: error when called from directory not tracked with Git
Browse files Browse the repository at this point in the history
Removes automatic refreshing behavior when toggling the minor mode.

Fixes #1
  • Loading branch information
gekoke committed May 20, 2024
1 parent 8fe12cb commit cb2eb65
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ If you are using some other method to install, you will need to ensure the follo

- `el-patch`
- `nerd-icons`
- `magit`

## Nix

Expand Down
8 changes: 3 additions & 5 deletions magit-file-icons.el
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

;; URL: https://github.com/gekoke/magit-file-icons
;; Package-Version: 1.0.0
;; Package-Requires: ((emacs "24.3") (magit "3.3.0") (nerd-icons "0.1.0") (el-patch "3.1"))
;; Package-Requires: ((emacs "24.3") (nerd-icons "0.1.0") (el-patch "3.1"))

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -88,13 +88,11 @@
(magit-file-icons-mode
(when magit-file-icons-enable-diff-file-section-icons (el-patch-eval-template #'magit-diff-insert-file-section 'defun))
(when magit-file-icons-enable-untracked-icons (el-patch-eval-template #'magit-insert-untracked-files 'defun))
(when magit-file-icons-enable-diffstat-icons (el-patch-eval-template #'magit-diff-wash-diffstat 'defun))
(magit-refresh))
(when magit-file-icons-enable-diffstat-icons (el-patch-eval-template #'magit-diff-wash-diffstat 'defun)))
('deactivate
(el-patch-unpatch #'magit-diff-insert-file-section 'defun nil)
(el-patch-unpatch #'magit-insert-untracked-files 'defun nil)
(el-patch-unpatch #'magit-diff-wash-diffstat 'defun nil)
(magit-refresh))))
(el-patch-unpatch #'magit-diff-wash-diffstat 'defun nil))))

(provide 'magit-file-icons)

Expand Down
2 changes: 1 addition & 1 deletion nix/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ _: {

packageRequires = [
pkgs.emacsPackages.el-patch
pkgs.emacsPackages.magit
pkgs.emacsPackages.nerd-icons
];

Expand All @@ -22,6 +21,7 @@ _: {
nativeCheckInputs = [
pkgs.git
pkgs.emacs
pkgs.emacsPackages.magit
] ++ packageRequires;

checkPhase = ''
Expand Down

0 comments on commit cb2eb65

Please sign in to comment.