From cb2eb65fb4bc3ee59d73d430675280c310be02ef Mon Sep 17 00:00:00 2001 From: Gregor Grigorjan Date: Mon, 20 May 2024 04:09:14 +0300 Subject: [PATCH] fix: error when called from directory not tracked with Git Removes automatic refreshing behavior when toggling the minor mode. Fixes #1 --- README.md | 1 - magit-file-icons.el | 8 +++----- nix/packages.nix | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 72784149..4c295db7 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/magit-file-icons.el b/magit-file-icons.el index 3f284e26..7bb17cd9 100644 --- a/magit-file-icons.el +++ b/magit-file-icons.el @@ -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 @@ -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) diff --git a/nix/packages.nix b/nix/packages.nix index f4488283..aa9c589b 100644 --- a/nix/packages.nix +++ b/nix/packages.nix @@ -13,7 +13,6 @@ _: { packageRequires = [ pkgs.emacsPackages.el-patch - pkgs.emacsPackages.magit pkgs.emacsPackages.nerd-icons ]; @@ -22,6 +21,7 @@ _: { nativeCheckInputs = [ pkgs.git pkgs.emacs + pkgs.emacsPackages.magit ] ++ packageRequires; checkPhase = ''