mirror of
https://github.com/neovim/neovim.git
synced 2025-09-13 23:08:16 +00:00
log: caller provides the source details
This commit is contained in:
@@ -15141,7 +15141,8 @@ static void f_sockconnect(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
}
|
||||
|
||||
const char *error = NULL;
|
||||
uint64_t id = channel_connect(tcp, address, 50, &error);
|
||||
eval_format_source_name_line((char *)IObuff, sizeof(IObuff));
|
||||
uint64_t id = channel_connect(tcp, address, 50, (char *)IObuff, &error);
|
||||
|
||||
if (error) {
|
||||
EMSG2(_("connection failed: %s"), error);
|
||||
@@ -22449,8 +22450,9 @@ static inline bool common_job_start(TerminalJobData *data, typval_T *rettv)
|
||||
|
||||
|
||||
if (data->rpc) {
|
||||
// the rpc channel takes over the in and out streams
|
||||
channel_from_process(proc, data->id);
|
||||
eval_format_source_name_line((char *)IObuff, sizeof(IObuff));
|
||||
// RPC channel takes over the in/out streams.
|
||||
channel_from_process(proc, data->id, (char *)IObuff);
|
||||
} else {
|
||||
wstream_init(proc->in, 0);
|
||||
if (proc->out) {
|
||||
@@ -22775,3 +22777,11 @@ bool eval_has_provider(const char *name)
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// Writes "<sourcing_name>:<sourcing_lnum>" to `buf[bufsize]`.
|
||||
void eval_format_source_name_line(char *buf, size_t bufsize)
|
||||
{
|
||||
snprintf(buf, bufsize, "%s:%" PRIdLINENR,
|
||||
(sourcing_name ? sourcing_name : (char_u *)"?"),
|
||||
(sourcing_name ? sourcing_lnum : 0));
|
||||
}
|
||||
|
Reference in New Issue
Block a user