Re: Commit: runtime(mswin): revert back the check for clipboard_working support

2024-03-13 Fir de Conversatie Tony Mechelynck
On Wed, Mar 13, 2024 at 4:45 PM Christian Brabandt  wrote:
>
> runtime(mswin): revert back the check for clipboard_working support
>
> Commit: 
> https://github.com/vim/vim/commit/760f664213dea9a300454992ba1589f4601d622f
> Author: Christian Brabandt 
> Date:   Wed Mar 13 16:38:16 2024 +0100
[…]

The mswin.vim script currently defines Ctrl-V and Shift-Insert in
Command-line mode but not Insert mode if has("clipboard") is found
true, but in Insert but not Command-line if it is found false. Is that
normal ?

Shouldnt cmap and inoremap be replaced by either map! or noremap! at
lines 43-44 and 60-61 of mswin.vim ?

Best regards,
Tony.

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/CAJkCKXvYrqZyi%3DXBLgyVtoVWVeKN-z0cBb96n7ZeT9CHq6SBqA%40mail.gmail.com.


Commit: runtime(mswin): revert back the check for clipboard_working support

2024-03-13 Fir de Conversatie Christian Brabandt
runtime(mswin): revert back the check for clipboard_working support

Commit: 
https://github.com/vim/vim/commit/760f664213dea9a300454992ba1589f4601d622f
Author: Christian Brabandt 
Date:   Wed Mar 13 16:38:16 2024 +0100

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: #13809

Signed-off-by: Christian Brabandt 

diff --git a/runtime/mswin.vim b/runtime/mswin.vim
index 3c10c0a6d..798d94061 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.
@@ -24,7 +24,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
@@ -40,7 +43,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
 vnoremapx

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/E1rkQmy-00H6RW-43%40256bit.org.