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

Fixed quickrun duplicating the source buffer on multiple runs #94

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
13 changes: 8 additions & 5 deletions quickrun.el
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ if you set your own language configuration.
(when eshell-buf
(kill-buffer eshell-buf))
(eshell)
(kill-buffer quickrun--buffer-name)
(quickrun--kill-quickrun-buffer)
(setq-local quickrun--shell-last-command cmd-str)
(add-hook 'eshell-post-command-hook 'quickrun--eshell-post-hook)
(quickrun--insert-command cmd-str)
Expand Down Expand Up @@ -899,7 +899,7 @@ if you set your own language configuration.
(defun quickrun--outputter-null ()
"Not documented."
(delete-region (point-min) (point-max))
(kill-buffer (get-buffer quickrun--buffer-name)))
(quickrun--kill-quickrun-buffer))

(defun quickrun--outputter-replace-region ()
"Not documented."
Expand Down Expand Up @@ -1382,9 +1382,12 @@ by quickrun.el. But you can register your own command for some languages")
(quickrun--add-remove-files dst)))

(defun quickrun--kill-quickrun-buffer ()
"Kill quickrun buffer."
(when (get-buffer quickrun--buffer-name)
(kill-buffer quickrun--buffer-name)))
(let (quickrun--buffer (get-buffer quickrun--buffer-name))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is a syntax error over here? Can you check this? Thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come this patch works? The variable quickrun--buffer will always return nil hence it will never run. 😕

(when quickrun--buffer
(let (quickrun--buffer-window (get-buffer-window quickrun--buffer-name))
(when quickrun--buffer-window
(delete-window quickrun--buffer-window)))
(kill-buffer quickrun--buffer))))

(defun quickrun--setup-exec-buffer (buf)
"Not documented."
Expand Down