-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Use ssh to connecting Linux, mapped shortcut keys in "mswin.vim" to operate the clipboard is not working. #13809
Comments
And I an already fixed this bug: 1d9f46b Can I pull request into master? |
You can create a pull request, but using the unnamed register is something very different then using the (system) wide clipboard. |
Yes, so it only takes effect when the system clipboard is not available. |
runtime(mswin): Use unnamed register when clipboard not working (vim/vim#13813) * Use unnamed register while clipboard not exist * Do not need to specify the unnamed register explicitly fixes: vim/vim#13809 vim/vim@d9ebd46 Co-authored-by: Shixian Li <34830785+znsoooo@users.noreply.github.com>
runtime(mswin): Use unnamed register when clipboard not working (vim/vim#13813) * Use unnamed register while clipboard not exist * Do not need to specify the unnamed register explicitly fixes: vim/vim#13809 vim/vim@d9ebd46 Co-authored-by: Shixian Li <34830785+znsoooo@users.noreply.github.com>
@clason the patch breaks gvim (vim-X11-9.1.158-1.fc39.x86_64) when running under X11 (XFCE) on Fedora Linux. The keyboard shortcuts don't work anymore. |
what exactly does not work? |
For example if I select some text in gvim and press Control+C , then Control+V in say Firefox the old content of the clipboard gets pasted. This means that the copy operation didn't put something new into the clipboard, i.e. it doesn't work. On the other hand, select, right click → Copy works fine. $ cat ~/.vim/vimrc
source $VIMRUNTIME/mswin.vim |
Please give more information. If you change line 27 from:
to
Does it start working? |
Yes. Either with the mouse or the keyboard by pressing Shift.
Yes. --- /usr/share/vim/vim91/mswin.vim 2024-03-08 02:00:00.000000000 +0200
+++ mswin.vim 2024-03-13 15:56:52.316998206 +0200
@@ -24,7 +24,7 @@
" backspace in Visual mode deletes selection
vnoremap <BS> d
-if has("clipboard_working")
+if has("clipboard")
" CTRL-X and SHIFT-Del are Cut
vnoremap <C-X> "+x
vnoremap <S-Del> "+x |
P.S. Pressing Control+V outputs The Paste from the right click menu works fine. |
Wait what? Where does that come from? Do you have this in your runtime file? Please show the output of
Hm, perhaps clipboard is not yet working when sourcing
That is expected. See |
Control+V used to work as on Windows (Notepad). |
Ah, so this must be your patched/working version. |
Yeah, with the patch proposed by you. |
Commit d9ebd46 changed the condition to check if the clipboard is available from: ``` has('clipboard') ``` to ``` has('clipboard_working') ``` Assuming that is the more accurate test because even when clipboard support is enabled at compile time it may not be actually working (e.g. if no X11 environment is available, or when working on a remote server). However it seems that condition does not evaluate to true, when the GUI has not been started up yet (and there was no X11 Connection yet possible). So let's just revert back the check to `has('clipboard')`, since that has been proven to be working well enough. related: #13809 Signed-off-by: Christian Brabandt <cb@256bit.org>
I reverted back the check. Please next time create a new issue |
runtime(mswin): revert back the check for clipboard_working support Commit d9ebd46bd090c598adc82e6 changed the condition to check if the clipboard is available from: ``` has('clipboard') ``` to ``` has('clipboard_working') ``` Assuming that is the more accurate test because even when clipboard support is enabled at compile time it may not be actually working (e.g. if no X11 environment is available, or when working on a remote server). However it seems that condition does not evaluate to true, when the GUI has not been started up yet (and there was no X11 Connection yet possible). So let's just revert back the check to `has('clipboard')`, since that has been proven to be working well enough. related: vim/vim#13809 vim/vim@760f664 Co-authored-by: Christian Brabandt <cb@256bit.org>
runtime(mswin): revert back the check for clipboard_working support Commit d9ebd46bd090c598adc82e6 changed the condition to check if the clipboard is available from: ``` has('clipboard') ``` to ``` has('clipboard_working') ``` Assuming that is the more accurate test because even when clipboard support is enabled at compile time it may not be actually working (e.g. if no X11 environment is available, or when working on a remote server). However it seems that condition does not evaluate to true, when the GUI has not been started up yet (and there was no X11 Connection yet possible). So let's just revert back the check to `has('clipboard')`, since that has been proven to be working well enough. related: vim/vim#13809 vim/vim@760f664 Co-authored-by: Christian Brabandt <cb@256bit.org>
Steps to reproduce
Expected behaviour
Use the Ctrl-C / Ctrl-X / Ctrl-V shortcut keys for clipboard operation while I'am using "mswin.vim" script.
Version of Vim
9.1.0
Environment
Ubuntu 18.04.6 LTS
Logs and stack traces
No response
The text was updated successfully, but these errors were encountered: