Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Use *nb-commits-log* instead of window height for legit log list
  • Loading branch information
jfaz1 authored and vindarel committed Jul 13, 2024
commit cde73f8745f9a3aef5095a6f7336d628aff09ef0
13 changes: 4 additions & 9 deletions extensions/legit/legit.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -633,10 +633,7 @@ Currently Git-only. Concretely, this calls Git with the -w option.")
(display-commits-log 0)))

(defun display-commits-log (offset)
(let* ((window-height (window-height (current-window)))
(commits-per-page (max 1 (- window-height 1)))
(commits (lem/porcelain:commits-log :offset offset
:limit commits-per-page)))
(let* ((commits (lem/porcelain:commits-log :offset offset :limit lem/porcelain:*nb-commits-log*)))
(lem/peek-legit:with-collecting-sources (collector :buffer :commits-log :read-only nil)
(lem/peek-legit:collector-insert
(format nil "Commits (~A):" offset)
Expand Down Expand Up @@ -673,11 +670,10 @@ Currently Git-only. Concretely, this calls Git with the -w option.")
(with-current-project ()
(let* ((buffer (current-buffer))
(window-height (window-height (current-window)))
(commits-per-page (max 1 (- window-height 1)))
(current-offset (or (buffer-value buffer 'commits-offset) 0))
(new-offset (+ current-offset commits-per-page))
(new-offset (+ current-offset lem/porcelain:*nb-commits-log*))
(commits (lem/porcelain:commits-log :offset new-offset
:limit commits-per-page)))
:limit lem/porcelain:*nb-commits-log*)))
(if commits
(display-commits-log new-offset)
(message "No more commits to display.")))))
Expand All @@ -686,9 +682,8 @@ Currently Git-only. Concretely, this calls Git with the -w option.")
(with-current-project ()
(let* ((buffer (current-buffer))
(window-height (window-height (current-window)))
(commits-per-page (max 1 (- window-height 1)))
(current-offset (or (buffer-value buffer 'commits-offset) 0))
(new-offset (max 0 (- current-offset commits-per-page))))
(new-offset (max 0 (- current-offset lem/porcelain:*nb-commits-log*))))
(display-commits-log new-offset))))

(define-command legit-quit () ()
Expand Down