Christian Brabandt wrote:
On Fr, 18 Dez 2020, Charles Campbell wrote:

Christian Brabandt (Vim Github Repository) wrote:
     As far as the clipboard goes: it copies the clipboard into a local
     variable, and only if the clipboard value has changed during the
     course of netrw's operation will netrw restore the clipboard value
     (thus avoiding having netrw always be the last one to modify the
     clipboard).

How about adding a configuration option to leave the clipboard alone if
set. This would solve two problems:

   * the clipboard won't be accessed at all if configured. That means,
     Neovim guys wouldn't have any problems, since the external
     clipboard provider may be slow.
   * It won't corrupt the clipboard in case of any non-text items in it.

People complaining could then set this variable and be fine.


The only problem -- something netrw does inadvertently modifies the
clipboard. That ends up with it being unexpectedly changed, which means
"clipboard won't be accessed at all" is not going to happen. Its like
history -- I don't want to change the history, but there's a lot of
operations that netrw does which change the history -- so there's a lot of
code to keep the history unchanged. I could have netrw optionally not
restore the clipboard, but I'm sure (because of earlier complaints) that
there will be a raft of new complaints. Well, I guess I'll put in
yet-another-option to prevent netrw from doing a save&restore of the
clipboard (g:netrw_clipboard).
When would that happen, that netrw modifies the clipboard
unintentionally. Wouldn't that only be the case when the clipboard
option is set or the guioption includes a/A/p?
In looking over guioption a/A, I think that they would prevent the issue. As I recall, the problem occurrs with wide listings, because netrw does use visual selection to construct the columns internally. However, I wouldn't be certain that there's nothing else involved. I suppose that I could have netrw save&restore guioption and safe-option a and A out.
(safe-option: what netrw uses while its constructing its display).


I suppose if the user explicitly uses "+y to paste to the clipboard in
netrw, that should be okay.

It'd be a help if vim itself had an option to leave something alone (ie.
setl leavealone="history:clipboard:jumps"); then netrw and other plugins
could set that, do their job, then unset it.
Wouldn't setting guioptions and clipboard option to a value that exclude
clipboard interaction be good enough?

There are NetrwKeepj commands all over the netrw code, and I'm not at all sure that it does that wherever needed even so, just to leave the jump table alone. I'll install the save&restore&safe guioption and see if that helps.

Regards,
Chip Campbell

--
--
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/acc1bba4-d6cc-8332-fda7-3d2e91fc1258%40drchip.org.

Raspunde prin e-mail lui