forked from aniani/vim
updated for version 7.3.594
Problem: The X command server doesn't work perfectly. It sends an empty reply for as-keys requests. Solution: Remove duplicate ga_init2(). Do not send a reply for as-keys requests. (Brian Burns)
This commit is contained in:
@@ -655,7 +655,6 @@ serverGetVimNames(dpy)
|
|||||||
if (SendInit(dpy) < 0)
|
if (SendInit(dpy) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
ga_init2(&ga, 1, 100);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Read the registry property.
|
* Read the registry property.
|
||||||
@@ -1198,9 +1197,8 @@ serverEventProc(dpy, eventPtr)
|
|||||||
if ((*p == 'c' || *p == 'k') && (p[1] == 0))
|
if ((*p == 'c' || *p == 'k') && (p[1] == 0))
|
||||||
{
|
{
|
||||||
Window resWindow;
|
Window resWindow;
|
||||||
char_u *name, *script, *serial, *end, *res;
|
char_u *name, *script, *serial, *end;
|
||||||
Bool asKeys = *p == 'k';
|
Bool asKeys = *p == 'k';
|
||||||
garray_T reply;
|
|
||||||
char_u *enc;
|
char_u *enc;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1256,12 +1254,21 @@ serverEventProc(dpy, eventPtr)
|
|||||||
if (script == NULL || name == NULL)
|
if (script == NULL || name == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/*
|
if (serverName != NULL && STRICMP(name, serverName) == 0)
|
||||||
* Initialize the result property, so that we're ready at any
|
{
|
||||||
* time if we need to return an error.
|
script = serverConvert(enc, script, &tofree);
|
||||||
*/
|
if (asKeys)
|
||||||
|
server_to_input_buf(script);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
char_u *res;
|
||||||
|
|
||||||
|
res = eval_client_expr_to_string(script);
|
||||||
if (resWindow != None)
|
if (resWindow != None)
|
||||||
{
|
{
|
||||||
|
garray_T reply;
|
||||||
|
|
||||||
|
/* Initialize the result property. */
|
||||||
ga_init2(&reply, 1, 100);
|
ga_init2(&reply, 1, 100);
|
||||||
#ifdef FEAT_MBYTE
|
#ifdef FEAT_MBYTE
|
||||||
ga_grow(&reply, 50 + STRLEN(p_enc));
|
ga_grow(&reply, 50 + STRLEN(p_enc));
|
||||||
@@ -1270,25 +1277,15 @@ serverEventProc(dpy, eventPtr)
|
|||||||
reply.ga_len = 14 + STRLEN(p_enc) + STRLEN(serial);
|
reply.ga_len = 14 + STRLEN(p_enc) + STRLEN(serial);
|
||||||
#else
|
#else
|
||||||
ga_grow(&reply, 50);
|
ga_grow(&reply, 50);
|
||||||
sprintf(reply.ga_data, "%cr%c-s %s%c-r ", 0, 0, serial, 0);
|
sprintf(reply.ga_data, "%cr%c-s %s%c-r ",
|
||||||
|
0, 0, serial, 0);
|
||||||
reply.ga_len = 10 + STRLEN(serial);
|
reply.ga_len = 10 + STRLEN(serial);
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
res = NULL;
|
/* Evaluate the expression and return the result. */
|
||||||
if (serverName != NULL && STRICMP(name, serverName) == 0)
|
|
||||||
{
|
|
||||||
script = serverConvert(enc, script, &tofree);
|
|
||||||
if (asKeys)
|
|
||||||
server_to_input_buf(script);
|
|
||||||
else
|
|
||||||
res = eval_client_expr_to_string(script);
|
|
||||||
vim_free(tofree);
|
|
||||||
}
|
|
||||||
if (resWindow != None)
|
|
||||||
{
|
|
||||||
if (res != NULL)
|
if (res != NULL)
|
||||||
ga_concat(&reply, res);
|
ga_concat(&reply, res);
|
||||||
else if (asKeys == 0)
|
else
|
||||||
{
|
{
|
||||||
ga_concat(&reply, (char_u *)_(e_invexprmsg));
|
ga_concat(&reply, (char_u *)_(e_invexprmsg));
|
||||||
ga_append(&reply, 0);
|
ga_append(&reply, 0);
|
||||||
@@ -1301,6 +1298,9 @@ serverEventProc(dpy, eventPtr)
|
|||||||
}
|
}
|
||||||
vim_free(res);
|
vim_free(res);
|
||||||
}
|
}
|
||||||
|
vim_free(tofree);
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (*p == 'r' && p[1] == 0)
|
else if (*p == 'r' && p[1] == 0)
|
||||||
{
|
{
|
||||||
int serial, gotSerial;
|
int serial, gotSerial;
|
||||||
|
@@ -714,6 +714,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 */
|
||||||
|
/**/
|
||||||
|
594,
|
||||||
/**/
|
/**/
|
||||||
593,
|
593,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user