Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add flag for force refresh #290

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

Merged
merged 7 commits into from
Jan 25, 2021
Merged
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
10 changes: 6 additions & 4 deletions dashboard.el
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@
(defvar dashboard--section-starts nil
"List of section starting positions.")

(defvar dashboard-force-refresh nil
"If non-nil, force refresh dashboard buffer.")

(defun dashboard-previous-section ()
"Navigate back to previous section."
(interactive)
Expand Down Expand Up @@ -195,7 +198,8 @@ Optional prefix ARG says how many lines to move; default is one line."
;; disabling/enabling recentf-mode)
(when recentf-is-on
(setq recentf-list (seq-take recentf-list dashboard-num-recents)))
(when (or (not (eq dashboard-buffer-last-width (window-width)))
(when (or dashboard-force-refresh
(not (eq dashboard-buffer-last-width (window-width)))
(not buffer-exists))
(setq dashboard-banner-length (window-width)
dashboard-buffer-last-width dashboard-banner-length)
Expand Down Expand Up @@ -240,9 +244,7 @@ Optional prefix ARG says how many lines to move; default is one line."
(defun dashboard-refresh-buffer ()
"Refresh buffer."
(interactive)
(when (get-buffer dashboard-buffer-name)
(kill-buffer dashboard-buffer-name))
(dashboard-insert-startupify-lists)
(let ((dashboard-force-refresh t)) (dashboard-insert-startupify-lists))
(switch-to-buffer dashboard-buffer-name))

(defun dashboard-resize-on-hook (&optional _)
Expand Down