Skip to content

Commit

Permalink
history: Don't prompt when latest-id does not match.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ambrevar committed Nov 22, 2022
1 parent 2075733 commit d53b60f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions source/history.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -353,11 +353,12 @@ Return non-NIL of history was restored, NIL otherwise."
(gethash (htree:creator-id owner) old-id->new-id)))
(htree:owners history))
(setf (htree:owners history) new-owners))
(alex:when-let ((latest-id (first
(first
(sort-by-time (alex:hash-table-alist (htree:owners history))
:key (compose #'htree:last-access #'rest))))))
(switch-buffer :buffer (buffers-get latest-id)))))
(alex:when-let* ((latest-id (first
(first
(sort-by-time (alex:hash-table-alist (htree:owners history))
:key (compose #'htree:last-access #'rest)))))
(buffer (buffers-get latest-id)))
(switch-buffer :buffer buffer))))

(defmethod files:deserialize ((profile nyxt-profile) (file history-file) raw-content &key)
"Restore the global/buffer-local history and session from the PATH."
Expand Down

0 comments on commit d53b60f

Please sign in to comment.