-
-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vi-mode: paste in visual mode copies the selected region #1221
Comments
Looking at this, inside of I'm not sure if there are best practices established around when to use vi registers, the killring, or the clipboard -- so with all of this in mind, I can think of a couple of ways of addressing this bug.
diff --git a/extensions/vi-mode/commands.lisp b/extensions/vi-mode/commands.lisp
index 62ff3c88..1dcf8d66 100644
--- a/extensions/vi-mode/commands.lisp
+++ b/extensions/vi-mode/commands.lisp
@@ -505,9 +506,11 @@
(cond
((visual-p)
(let ((visual-line (visual-line-p)))
- (multiple-value-bind (beg end type)
- (visual-region)
- (vi-delete beg end type))
+ (lem-core::with-enable-clipboard nil
+ (multiple-value-bind (beg end type)
+ (visual-region)
+ (vi-delete beg end type))
+ (rotate-killring (current-killring)))
(when (and (not visual-line)
(eq type :line))
(insert-character (current-point) #\Newline))))
...
diff --git a/extensions/vi-mode/commands.lisp b/extensions/vi-mode/commands.lisp
index 62ff3c88..02181899 100644
--- a/extensions/vi-mode/commands.lisp
+++ b/extensions/vi-mode/commands.lisp
@@ -508,6 +510,7 @@
(multiple-value-bind (beg end type)
(visual-region)
(vi-delete beg end type))
+ (copy-to-clipboard-with-killring string)
(when (and (not visual-line)
(eq type :line))
(insert-character (current-point) #\Newline))))
...
|
In normal mode, I can paste the yanked text normally, but when I go to visual mode and paste the text with
p
, it yanks the text instead of pasting it.The text was updated successfully, but these errors were encountered: