mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.0.0476: missing change to main.c
Problem: Missing change to main.c. Solution: Add new function.
This commit is contained in:
41
src/main.c
41
src/main.c
@@ -4140,6 +4140,11 @@ eval_client_expr_to_string(char_u *expr)
|
|||||||
char_u *res;
|
char_u *res;
|
||||||
int save_dbl = debug_break_level;
|
int save_dbl = debug_break_level;
|
||||||
int save_ro = redir_off;
|
int save_ro = redir_off;
|
||||||
|
void *fc;
|
||||||
|
|
||||||
|
/* Evaluate the expression at the toplevel, don't use variables local to
|
||||||
|
* the calling function. */
|
||||||
|
fc = clear_current_funccal();
|
||||||
|
|
||||||
/* Disable debugging, otherwise Vim hangs, waiting for "cont" to be
|
/* Disable debugging, otherwise Vim hangs, waiting for "cont" to be
|
||||||
* typed. */
|
* typed. */
|
||||||
@@ -4156,6 +4161,7 @@ eval_client_expr_to_string(char_u *expr)
|
|||||||
--emsg_silent;
|
--emsg_silent;
|
||||||
if (emsg_silent < 0)
|
if (emsg_silent < 0)
|
||||||
emsg_silent = 0;
|
emsg_silent = 0;
|
||||||
|
restore_current_funccal(fc);
|
||||||
|
|
||||||
/* A client can tell us to redraw, but not to display the cursor, so do
|
/* A client can tell us to redraw, but not to display the cursor, so do
|
||||||
* that here. */
|
* that here. */
|
||||||
@@ -4169,6 +4175,41 @@ eval_client_expr_to_string(char_u *expr)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Evaluate a command or expression sent to ourselves.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
sendToLocalVim(char_u *cmd, int asExpr, char_u **result)
|
||||||
|
{
|
||||||
|
if (asExpr)
|
||||||
|
{
|
||||||
|
char_u *ret;
|
||||||
|
|
||||||
|
ret = eval_client_expr_to_string(cmd);
|
||||||
|
if (result != NULL)
|
||||||
|
{
|
||||||
|
if (ret == NULL)
|
||||||
|
{
|
||||||
|
char *err = _(e_invexprmsg);
|
||||||
|
size_t len = STRLEN(cmd) + STRLEN(err) + 5;
|
||||||
|
char_u *msg;
|
||||||
|
|
||||||
|
msg = alloc(len);
|
||||||
|
if (msg != NULL)
|
||||||
|
vim_snprintf((char *)msg, len, "%s: \"%s\"", err, cmd);
|
||||||
|
*result = msg;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
*result = ret;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
vim_free(ret);
|
||||||
|
return ret == NULL ? -1 : 0;
|
||||||
|
}
|
||||||
|
server_to_input_buf(cmd);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If conversion is needed, convert "data" from "client_enc" to 'encoding' and
|
* If conversion is needed, convert "data" from "client_enc" to 'encoding' and
|
||||||
* return an allocated string. Otherwise return "data".
|
* return an allocated string. Otherwise return "data".
|
||||||
|
@@ -764,6 +764,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
476,
|
||||||
/**/
|
/**/
|
||||||
475,
|
475,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user