clipboard: avoid error flood during :redir

redir_write():
- This is a "batch" operation which was not yet covered by
  start_batch_changes()

adjust_clipboard_name():
- msg() and friends during :redir will, of course, cause redir_write()
  to try to capture that message, which causes recursion.
- EMSG() here is trouble: if it interrupts :redir it is a mess.
  Rather than deal with the mess, show a non-error message.

closes #7182
closes #7184
closes #7183
ref #6048
ref #7032
This commit is contained in:
Justin M. Keyes
2017-08-20 02:13:04 +02:00
parent b3da396804
commit 9882e25dc4
6 changed files with 99 additions and 54 deletions

View File

@@ -22775,7 +22775,7 @@ typval_T eval_call_provider(char *provider, char *method, list_T *arguments)
bool eval_has_provider(const char *name)
{
#define check_provider(name) \
#define CHECK_PROVIDER(name) \
if (has_##name == -1) { \
has_##name = !!find_func((char_u *)"provider#" #name "#Call"); \
if (!has_##name) { \
@@ -22791,17 +22791,17 @@ bool eval_has_provider(const char *name)
static int has_python3 = -1;
static int has_ruby = -1;
if (!strcmp(name, "clipboard")) {
check_provider(clipboard);
if (strequal(name, "clipboard")) {
CHECK_PROVIDER(clipboard);
return has_clipboard;
} else if (!strcmp(name, "python3")) {
check_provider(python3);
} else if (strequal(name, "python3")) {
CHECK_PROVIDER(python3);
return has_python3;
} else if (!strcmp(name, "python")) {
check_provider(python);
} else if (strequal(name, "python")) {
CHECK_PROVIDER(python);
return has_python;
} else if (!strcmp(name, "ruby")) {
check_provider(ruby);
} else if (strequal(name, "ruby")) {
CHECK_PROVIDER(ruby);
return has_ruby;
}