aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Brumlow <mbrumlow@gmail.com>2019-08-07 14:27:09 -0500
committerMichael Brumlow <mbrumlow@gmail.com>2019-08-07 14:34:45 -0500
commit0a444b89307e07e729078eea114ba44f92f0fa83 (patch)
treef744f0231f605d0389a2dd7aa23e7618db3416a0
parent99511023cfc5bb524e157914fe943ca450b89942 (diff)
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.
-rw-r--r--vterm.el5
1 files changed, 4 insertions, 1 deletions
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)))