mirror of
https://github.com/vale981/py-vterm-interaction.el
synced 2025-03-04 17:41:40 -05:00
Allow ending copy mode with C-c C-t (#3)
When ending julia-vterm-repl-copy-mode by pressing C-c C-t, the Julia process remains stopped and the buffer is almost unusable, because it does not have its local keymap set. The only working way to terminate the copy mode is by pressing RET, but this requires an active region. This commit fixes the above problem by moving the code for ending the copy mode to julia-vterm-repl-copy-mode. Now the copy mode can be terminated by both RET and C-c C-t.
This commit is contained in:
parent
d4d5c50f15
commit
742ce656e2
1 changed files with 10 additions and 9 deletions
|
@ -154,10 +154,15 @@ If there's already one with the process alive, just open it."
|
|||
:group 'julia-vterm-repl
|
||||
:lighter " VTermCopy"
|
||||
:keymap julia-vterm-repl-copy-mode-map
|
||||
(when julia-vterm-repl-copy-mode
|
||||
(if julia-vterm-repl-copy-mode
|
||||
(progn
|
||||
(message "Start copy mode")
|
||||
(use-local-map nil)
|
||||
(vterm-send-stop)))
|
||||
(vterm-send-stop))
|
||||
(vterm-reset-cursor-point)
|
||||
(use-local-map julia-vterm-repl-mode-map)
|
||||
(vterm-send-start)
|
||||
(message "End copy mode")))
|
||||
|
||||
(defun julia-vterm-repl-copy-mode-done ()
|
||||
"Save the active region to the kill ring and exit copy mode."
|
||||
|
@ -165,11 +170,7 @@ If there's already one with the process alive, just open it."
|
|||
(if (region-active-p)
|
||||
(kill-ring-save (region-beginning) (region-end))
|
||||
(user-error "No active region"))
|
||||
(julia-vterm-repl-copy-mode -1)
|
||||
(vterm-reset-cursor-point)
|
||||
(use-local-map julia-vterm-repl-mode-map)
|
||||
(vterm-send-start)
|
||||
(message "End copy mode"))
|
||||
(julia-vterm-repl-copy-mode -1))
|
||||
|
||||
|
||||
;;----------------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Reference in a new issue