Add modified-buffer confirmation to doom/kill-real-buffer
This commit is contained in:
parent
ed6c8da07c
commit
f58df5f061
1 changed files with 5 additions and 1 deletions
|
@ -106,10 +106,14 @@ the buffer if it is being displayed in another window."
|
||||||
(when arg (message "Already in scratch buffer")))
|
(when arg (message "Already in scratch buffer")))
|
||||||
(doom/previous-real-buffer))
|
(doom/previous-real-buffer))
|
||||||
(let ((new-dir (doom/project-root)))
|
(let ((new-dir (doom/project-root)))
|
||||||
(if (doom/popup-p (selected-window))
|
(if (doom/popup-p)
|
||||||
(doom/popup-close)
|
(doom/popup-close)
|
||||||
(if (> (length (get-buffer-window-list (current-buffer) nil t)) 1)
|
(if (> (length (get-buffer-window-list (current-buffer) nil t)) 1)
|
||||||
(bury-buffer)
|
(bury-buffer)
|
||||||
|
(when (and buffer-file-name (buffer-modified-p))
|
||||||
|
(if (yes-or-no-p "Buffer is unsaved, save it?")
|
||||||
|
(save-buffer)
|
||||||
|
(set-buffer-modified-p nil)))
|
||||||
(kill-this-buffer))
|
(kill-this-buffer))
|
||||||
(unless (doom/real-buffer-p (current-buffer))
|
(unless (doom/real-buffer-p (current-buffer))
|
||||||
(doom/previous-real-buffer))
|
(doom/previous-real-buffer))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue