mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
parent
ecd7beb6e4
commit
7be113d795
@ -19,6 +19,7 @@
|
|||||||
#include "nvim/fileio.h"
|
#include "nvim/fileio.h"
|
||||||
#include "nvim/func_attr.h"
|
#include "nvim/func_attr.h"
|
||||||
#include "nvim/getchar.h"
|
#include "nvim/getchar.h"
|
||||||
|
#include "nvim/main.h"
|
||||||
#include "nvim/mbyte.h"
|
#include "nvim/mbyte.h"
|
||||||
#include "nvim/memory.h"
|
#include "nvim/memory.h"
|
||||||
#include "nvim/misc1.h"
|
#include "nvim/misc1.h"
|
||||||
@ -581,6 +582,24 @@ bool emsgf(const char *const fmt, ...)
|
|||||||
return emsg(IObuff);
|
return emsg(IObuff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void msg_emsgf_event(void **argv)
|
||||||
|
{
|
||||||
|
char *s = argv[0];
|
||||||
|
(void)emsg((char_u *)s);
|
||||||
|
xfree(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
void msg_schedule_emsgf(const char *const fmt, ...)
|
||||||
|
{
|
||||||
|
va_list ap;
|
||||||
|
va_start(ap, fmt);
|
||||||
|
vim_vsnprintf((char *)IObuff, IOSIZE, fmt, ap, NULL);
|
||||||
|
va_end(ap);
|
||||||
|
|
||||||
|
char *s = xstrdup((char *)IObuff);
|
||||||
|
loop_schedule(&main_loop, event_create(1, msg_emsgf_event, 1, s));
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Like msg(), but truncate to a single line if p_shm contains 't', or when
|
* Like msg(), but truncate to a single line if p_shm contains 't', or when
|
||||||
* "force" is TRUE. This truncates in another way as for normal messages.
|
* "force" is TRUE. This truncates in another way as for normal messages.
|
||||||
|
@ -548,8 +548,8 @@ static void shell_write_cb(Stream *stream, void *data, int status)
|
|||||||
if (status) {
|
if (status) {
|
||||||
// Can happen if system() tries to send input to a shell command that was
|
// Can happen if system() tries to send input to a shell command that was
|
||||||
// backgrounded (:call system("cat - &", "foo")). #3529 #5241
|
// backgrounded (:call system("cat - &", "foo")). #3529 #5241
|
||||||
EMSG2(_("E5677: Error writing input to shell-command: %s"),
|
msg_schedule_emsgf(_("E5677: Error writing input to shell-command: %s"),
|
||||||
uv_err_name(status));
|
uv_err_name(status));
|
||||||
}
|
}
|
||||||
if (stream->closed) { // Process may have exited before this write.
|
if (stream->closed) { // Process may have exited before this write.
|
||||||
ELOG("stream was already closed");
|
ELOG("stream was already closed");
|
||||||
|
@ -177,14 +177,14 @@ void ui_refresh(void)
|
|||||||
pum_set_external(pum_external);
|
pum_set_external(pum_external);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ui_refresh_handler(void **argv)
|
static void ui_refresh_event(void **argv)
|
||||||
{
|
{
|
||||||
ui_refresh();
|
ui_refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ui_schedule_refresh(void)
|
void ui_schedule_refresh(void)
|
||||||
{
|
{
|
||||||
loop_schedule(&main_loop, event_create(1, ui_refresh_handler, 0));
|
loop_schedule(&main_loop, event_create(1, ui_refresh_event, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ui_resize(int new_width, int new_height)
|
void ui_resize(int new_width, int new_height)
|
||||||
|
Loading…
Reference in New Issue
Block a user