summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-11-30 18:12:19 +0000
committerBram Moolenaar <Bram@vim.org>2022-11-30 18:12:19 +0000
commit4c5678ff0c376661d4a8183a5a074a1203413b9d (patch)
tree2ddd73cae34d17f2eb4290fda1131bb63f4a0fab /src/main.c
parenta87749e3eae3f918b6678f45cf975f0cf06d3e97 (diff)
patch 9.0.0977: it is not easy to see what client-server commands are doingv9.0.0977
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.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main.c b/src/main.c
index db81a3f3cf..9081657691 100644
--- a/src/main.c
+++ b/src/main.c
@@ -152,7 +152,7 @@ main
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 @@ may_trigger_safestate(int safe)
{
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 @@ may_trigger_safestate(int safe)
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 @@ may_trigger_safestateagain(void)
// 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 @@ may_trigger_safestateagain(void)
#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_preserve_modified(int exitval)
getout(int exitval)
{
exiting = TRUE;
-#if defined(FEAT_JOB_CHANNEL)
+#if defined(FEAT_EVAL)
ch_log(NULL, "Exiting...");
#endif