Make send-region-or-current-line respect silent-cells (#4)

Previously only cells and functions could be sent "silently".
This commit is contained in:
John Lapeyre 2025-01-21 12:00:59 -05:00 committed by GitHub
parent 6ea07943ff
commit 9c85cdaf4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -116,7 +116,8 @@ C-c C-z py-vterm-interaction-switch-to-repl-buffer
C-c C-c py-vterm-interaction-send-region-or-current-line
Send the content of the region if the region is active, or send the current
line.
line. If the region is active and py-vterm-interaction-silent-cells is set to t
then the region is sent using ipython %run magic.
C-c C-b py-vterm-interaction-send-buffer
Send the whole content of the script buffer to the Python REPL line by line.

View file

@ -504,7 +504,7 @@ Otherwise, send the current line."
(interactive)
(if (use-region-p)
(let ((str (buffer-substring-no-properties (region-beginning) (region-end))))
(py-vterm-interaction-paste-string str)
(py-vterm-interaction--send-maybe-silent str "region")
(deactivate-mark))
(py-vterm-interaction-send-current-line)))