]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(mswin): revert back the check for clipboard_working support
authorChristian Brabandt <cb@256bit.org>
Wed, 13 Mar 2024 15:38:16 +0000 (16:38 +0100)
committerChristian Brabandt <cb@256bit.org>
Wed, 13 Mar 2024 15:38:16 +0000 (16:38 +0100)
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: #13809

Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/mswin.vim

index 3c10c0a6d8070097aece42b691769cf11b4ecfff..798d94061c1aafecc11a054ef835b5b45f4aa2be 100644 (file)
@@ -1,7 +1,7 @@
 " Set options and add mapping such that Vim behaves a lot like MS-Windows
 "
 " Maintainer:  The Vim Project <https://github.com/vim/vim>
-" Last Change: 2024 Mar 3
+" Last Change: 2024 Mar 13
 " Former Maintainer:   Bram Moolenaar <Bram@vim.org>
 
 " Bail out if this isn't wanted.
@@ -24,7 +24,10 @@ set backspace=indent,eol,start whichwrap+=<,>,[,]
 " backspace in Visual mode deletes selection
 vnoremap <BS> 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 <C-X> "+x
     vnoremap <S-Del> "+x
@@ -40,7 +43,7 @@ if has("clipboard_working")
     cmap <C-V>         <C-R>+
     cmap <S-Insert>            <C-R>+
 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 <C-X>   x