mirror of
https://github.com/vale981/py-vterm-interaction.el
synced 2025-03-04 09:31:40 -05:00
add function and keybinding to rerun last repl command
This commit is contained in:
parent
f91baed57a
commit
c93ea742db
2 changed files with 15 additions and 1 deletions
|
@ -143,6 +143,9 @@ C-c C-i Import the current buffer file like `from <module> import *' in the
|
|||
C-c C-d py-vterm-interaction-send-cd-to-buffer-directory
|
||||
Send %cd function call to the Python REPL to change the current working
|
||||
directory of REPL to the buffer's directory.
|
||||
|
||||
C-c C-a py-vterm-interaction-send-rerun-last
|
||||
Send C-p <return> to the repl to rerun the last line entered.
|
||||
#+end_example
|
||||
|
||||
*** py-vterm-interaction-repl-mode
|
||||
|
|
|
@ -644,6 +644,16 @@ python vterm buffer."
|
|||
(setq default-directory buffer-directory)))
|
||||
(message "The buffer is not associated with a directory.")))
|
||||
|
||||
(defun py-vterm-interaction-send-rerun-last ()
|
||||
"Rerun last repl command.
|
||||
|
||||
(Send C-p <return>)"
|
||||
(interactive)
|
||||
(py-vterm-interaction-clear-line)
|
||||
(with-current-buffer (py-vterm-interaction-fellow-repl-buffer)
|
||||
(vterm-send-key (kbd "C-p"))
|
||||
(py-vterm-interaction-send-return-key)))
|
||||
|
||||
(defalias 'py-vterm-interaction-sync-wd #'py-vterm-interaction-send-cd-to-buffer-directory)
|
||||
|
||||
(defun py-vterm-interaction-fellow-repl-prompt-status ()
|
||||
|
@ -664,7 +674,8 @@ python vterm buffer."
|
|||
(,(kbd "C-c C-i") . ,#'py-vterm-interaction-send-import-buffer-file)
|
||||
(,(kbd "C-c C-b") . ,#'py-vterm-interaction-send-buffer)
|
||||
(,(kbd "C-c C-r") . ,#'py-vterm-interaction-send-run-buffer-file)
|
||||
(,(kbd "C-c C-d") . ,#'py-vterm-interaction-send-cd-to-buffer-directory)))
|
||||
(,(kbd "C-c C-d") . ,#'py-vterm-interaction-send-cd-to-buffer-directory)
|
||||
(,(kbd "C-c C-a") . ,#'py-vterm-interaction-send-rerun-last)))
|
||||
|
||||
|
||||
(provide 'py-vterm-interaction)
|
||||
|
|
Loading…
Add table
Reference in a new issue