fix send-buffer for standard python

This commit is contained in:
Valentin Boettcher 2024-05-16 11:44:41 -04:00
parent 862eb0dcd3
commit 4558d98099
No known key found for this signature in database
GPG key ID: E034E12B7AF56ACE

View file

@ -533,15 +533,18 @@ If the function has no arguments, the function call is run immediately."
(defun python-vterm-send-buffer () (defun python-vterm-send-buffer ()
"Send the whole content of the script buffer to the Python REPL line by line." "Send the whole content of the script buffer to the Python REPL line by line."
(interactive) (interactive)
(save-excursion (let ((python-vterm-paste-with-return t)
(python-vterm-paste-string (python-vterm-ensure-newline (buffer-string))))) (python-vterm-paste-with-clear nil))
(python-vterm-paste-string (buffer-string))))
(defun python-vterm-send-run-buffer-file () (defun python-vterm-send-run-buffer-file ()
"Run the current buffer file in the python vterm buffer. "Run the current buffer file in the python vterm buffer.
This is equivalent to running `%run -i <buffer-file-name>` in the python vterm buffer." This is equivalent to running `%run -i <buffer-file-name>` in the python vterm buffer."
(interactive) (interactive)
(let ((file buffer-file-name)) (let ((file buffer-file-name)
(python-vterm-paste-with-return t))
(with-current-buffer (python-vterm-fellow-repl-buffer) (with-current-buffer (python-vterm-fellow-repl-buffer)
(python-vterm-paste-string (python-vterm--load-file file "load script buffer"))))) (python-vterm-paste-string (python-vterm--load-file file "load script buffer")))))