1
0
forked from aniani/vim

patch 8.2.5056: the channel log only contains some of the raw terminal output

Problem:    The channel log only contains some of the raw terminal output.
Solution:   Add the "o" flag to log all terminal output.  Use it for "--log".
This commit is contained in:
Bram Moolenaar
2022-06-04 22:15:54 +01:00
parent 327e6dd822
commit 1d97db3d98
10 changed files with 58 additions and 63 deletions

View File

@@ -152,7 +152,8 @@ static proftime_T log_start;
void
ch_logfile(char_u *fname, char_u *opt)
{
FILE *file = NULL;
FILE *file = NULL;
char *mode = "a";
if (log_fd != NULL)
{
@@ -163,9 +164,14 @@ ch_logfile(char_u *fname, char_u *opt)
fclose(log_fd);
}
// The "a" flag overrules the "w" flag.
if (vim_strchr(opt, 'a') == NULL && vim_strchr(opt, 'w') != NULL)
mode = "w";
ch_log_output = vim_strchr(opt, 'o') != NULL ? LOG_ALWAYS : FALSE;
if (*fname != NUL)
{
file = fopen((char *)fname, *opt == 'w' ? "w" : "a");
file = fopen((char *)fname, mode);
if (file == NULL)
{
semsg(_(e_cant_open_file_str), fname);