Skip to content

Commit

Permalink
Fix: (magit-todos-defscanner) Don't run nil commands with nice
Browse files Browse the repository at this point in the history
Fixes #153.

Reported-by: Yukari Hafner <https://github.com/Shinmera>
  • Loading branch information
alphapapa committed Feb 13, 2024
1 parent d85518d commit 835ae27
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions magit-todos.el
Original file line number Diff line number Diff line change
Expand Up @@ -1310,17 +1310,15 @@ When SYNC is non-nil, match items are returned."
(optional (group-n 6 (regexp ,magit-todos-keyword-suffix)))
(optional (1+ blank))
(optional (group-n 5 (1+ not-newline)))))))))
(command (-flatten
(-non-nil
(list (when magit-todos-nice
(list "nice" "-n5"))
,command)))))
(command (-flatten (-non-nil ,command))))
;; Convert any numbers in command to strings (e.g. depth).
(cl-loop for elt in-ref command
when (numberp elt)
do (setf elt (number-to-string elt)))
;; Run command.
(when command
(when magit-todos-nice
(setf command (append (list "nice" "-n5") command)))
(if sync
;; Synchronous: return matching items.
(with-temp-buffer
Expand Down

0 comments on commit 835ae27

Please sign in to comment.