From ff972b88db89927c8e0c1a5d76c999bb80636d92 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 14 Mar 2024 13:37:29 +0800 Subject: vim-patch:760f664213de 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 https://github.com/vim/vim/commit/760f664213dea9a300454992ba1589f4601d622f Co-authored-by: Christian Brabandt --- runtime/mswin.vim | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'runtime') diff --git a/runtime/mswin.vim b/runtime/mswin.vim index 107a2acc2e..d419146958 100644 --- a/runtime/mswin.vim +++ b/runtime/mswin.vim @@ -1,7 +1,7 @@ " Set options and add mapping such that Vim behaves a lot like MS-Windows " " Maintainer: The Vim Project -" Last Change: 2024 Mar 3 +" Last Change: 2024 Mar 13 " Former Maintainer: Bram Moolenaar " Bail out if this isn't wanted. @@ -27,7 +27,10 @@ set backspace=indent,eol,start whichwrap+=<,>,[,] " backspace in Visual mode deletes selection vnoremap d -if has("clipboard_working") +" the better solution would be to use has("clipboard_working"), +" but that may not be available yet while starting up, so let's just check if +" clipboard support has been compiled in and assume it will be working :/ +if has("clipboard") " CTRL-X and SHIFT-Del are Cut vnoremap "+x vnoremap "+x @@ -43,7 +46,7 @@ if has("clipboard_working") cmap + cmap + else - " Use unnamed register while clipboard not exist + " Use the unnamed register when clipboard support not available " CTRL-X and SHIFT-Del are Cut vnoremap x -- cgit From 2aa84ce210af8ec8f80dd4972926dbc60971526b Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 14 Mar 2024 15:04:14 +0800 Subject: vim-patch:45da32964d6e runtime(mswin): still another clipboard_working test Commit 760f664213dea9a300454992ba1589f4601d622f missed to revert back another test for `if has('clipboard_working')` So change the remaining check around the inoremap mappings. fixes vim/vim#14195 https://github.com/vim/vim/commit/45da32964d6e7e635af8fcf0b42e974b0b536ed3 Co-authored-by: Christian Brabandt --- runtime/mswin.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime') diff --git a/runtime/mswin.vim b/runtime/mswin.vim index d419146958..689bc792cf 100644 --- a/runtime/mswin.vim +++ b/runtime/mswin.vim @@ -70,7 +70,7 @@ endif " Uses the paste.vim autoload script. " Use CTRL-G u to have CTRL-Z only undo the paste. -if has("clipboard_working") +if has("clipboard") exe 'inoremap