patch 9.0.0977: it is not easy to see what client-server commands are doing
Problem: It is not easy to see what client-server commands are doing.
Solution: Add channel log messages if ch_log() is available. Move the
channel logging and make it available with the +eval feature.
diff --git a/src/main.c b/src/main.c
index db81a3f..9081657 100644
--- a/src/main.c
+++ b/src/main.c
@@ -152,7 +152,7 @@
TIME_MSG("--- VIM STARTING ---");
}
# endif
-# ifdef FEAT_JOB_CHANNEL
+# ifdef FEAT_EVAL
if (STRICMP(argv[i], "--log") == 0)
ch_logfile((char_u *)(argv[i + 1]), (char_u *)"ao");
# endif
@@ -1084,7 +1084,7 @@
{
int is_safe = safe && is_safe_now();
-#ifdef FEAT_JOB_CHANNEL
+#ifdef FEAT_EVAL
if (was_safe != is_safe)
// Only log when the state changes, otherwise it happens at nearly
// every key stroke.
@@ -1104,7 +1104,7 @@
void
state_no_longer_safe(char *reason UNUSED)
{
-#ifdef FEAT_JOB_CHANNEL
+#ifdef FEAT_EVAL
if (was_safe)
ch_log(NULL, "SafeState: reset: %s", reason);
#endif
@@ -1133,14 +1133,14 @@
// of calling feedkeys(), we check if it's now safe again (all keys
// were consumed).
was_safe = is_safe_now();
-#ifdef FEAT_JOB_CHANNEL
+#ifdef FEAT_EVAL
if (was_safe)
ch_log(NULL, "SafeState: undo reset");
#endif
}
if (was_safe)
{
-#ifdef FEAT_JOB_CHANNEL
+#ifdef FEAT_EVAL
// Only do this message when another message was given, otherwise we
// get lots of them.
if ((did_repeated_msg & REPEATED_MSG_SAFESTATE) == 0)
@@ -1154,7 +1154,7 @@
#endif
apply_autocmds(EVENT_SAFESTATEAGAIN, NULL, NULL, FALSE, curbuf);
}
-#ifdef FEAT_JOB_CHANNEL
+#ifdef FEAT_EVAL
else
ch_log(NULL,
"SafeState: back to waiting, not triggering SafeStateAgain");
@@ -1563,7 +1563,7 @@
getout(int exitval)
{
exiting = TRUE;
-#if defined(FEAT_JOB_CHANNEL)
+#if defined(FEAT_EVAL)
ch_log(NULL, "Exiting...");
#endif