Skip to content

Commit

Permalink
Turn defvar to defcustom (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
wyuenho authored Jan 4, 2021
1 parent b8526f8 commit fc4de96
Showing 1 changed file with 30 additions and 14 deletions.
44 changes: 30 additions & 14 deletions magit-delta.el
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,27 @@
(require 'xterm-color)
(require 'dash)

(defvar magit-delta-delta-executable "delta"
"The delta executable on your system to be used by Magit.")

(defvar magit-delta-default-light-theme "GitHub"
"The default color theme when Emacs has a light background.")

(defvar magit-delta-default-dark-theme "Monokai Extended"
"The default color theme when Emacs has a dark background.")

(defvar magit-delta-delta-args
(defgroup magit-delta nil
"Magit delta customizations."
:group 'magit-diff
:group 'magit-modes)

(defcustom magit-delta-delta-executable "delta"
"The delta executable on your system to be used by Magit."
:type 'string
:group 'magit-delta)

(defcustom magit-delta-default-light-theme "GitHub"
"The default color theme when Emacs has a light background."
:type 'string
:group 'magit-delta)

(defcustom magit-delta-default-dark-theme "Monokai Extended"
"The default color theme when Emacs has a dark background."
:type 'string
:group 'magit-delta)

(defcustom magit-delta-delta-args
`("--max-line-distance" "0.6"
"--24-bit-color" ,(if xterm-color--support-truecolor "always" "never")
"--color-only")
Expand All @@ -42,10 +53,15 @@ frame has a light or dark background. See `magit-delta-default-light-theme' and
`magit-delta-default-dark-theme'.
--color-only is required in order to use delta with magit; it
will be added if not present.")

(defvar magit-delta-hide-plus-minus-markers t
"Whether to hide the +/- markers at the beginning of diff lines.")
will be added if not present."
:type '(repeat string)
:group 'magit-delta)

(defcustom magit-delta-hide-plus-minus-markers t
"Whether to hide the +/- markers at the beginning of diff lines."
:type '(choice (const :tag "Hide" t)
(const :tag "Show" nil))
:group 'magit-delta)

(defun magit-delta--make-delta-args ()
"Make final list of delta command-line arguments."
Expand Down

0 comments on commit fc4de96

Please sign in to comment.