From 0a444b89307e07e729078eea114ba44f92f0fa83 Mon Sep 17 00:00:00 2001 From: Michael Brumlow Date: Wed, 7 Aug 2019 14:27:09 -0500 Subject: Save and restore point in copy mode. This change will save the point when entering copy mode and restore it back once leaving. This feels much nicer than having the point get out of sync with where the terminal actually thinks it is. If the creators of vterm know of a better way I would be glad to figure out how to implement it, but for now this seems to work fine. --- vterm.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vterm.el b/vterm.el index eb30382..ecced84 100644 --- a/vterm.el +++ b/vterm.el @@ -298,7 +298,10 @@ If nil, never delay") (if vterm-copy-mode (progn ;enable vterm-copy-mode (use-local-map nil) - (vterm-send-stop)) + (vterm-send-stop) + (set (make-local-variable 'vterm-copy-saved-point) (point))) + (if vterm-copy-saved-point + (goto-char vterm-copy-saved-point)) (use-local-map vterm-mode-map) (vterm-send-start))) -- cgit v1.0