Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configurable spacing between dired and the git info #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,10 @@ the following:
(add-hook 'dired-after-readin-hook 'dired-git-info-auto-enable)
#+END_SRC

** Set the spacing between the file names and the git info

If you want more room between the ~dired~ filenames and the git information than
the default 2 spaces, use the following:
#+BEGIN_SRC elisp
(setq dgi-spacing 5)
#+END_SRC
6 changes: 5 additions & 1 deletion dired-git-info.el
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ are (see git-log PRETTY FORMATS for all):
· %f: sanitized subject line, suitable for a filename"
:type 'string)

(defcustom dgi-spacing 2
"How many spaces between the longest filename and the commit messages"
:type 'integer)

(defvar-local dgi--commit-ovs nil
"Overlays which show the commit messages.")

Expand Down Expand Up @@ -220,7 +224,7 @@ info format and defaults to `dgi-commit-message-format'."
(dired-unmark-all-marks)
(dired-toggle-marks)
(dired-get-marked-files)))
(minspc (1+ (apply #'max (dgi--get-dired-files-length files))))
(minspc (+ dgi-spacing (apply #'max (dgi--get-dired-files-length files))))
(messages (dgi--get-commit-messages files)))
(save-excursion
(dolist (file files)
Expand Down