Skip to content

Commit

Permalink
Merge branch 'vim'
Browse files Browse the repository at this point in the history
  • Loading branch information
genoma committed Jul 10, 2014
2 parents da2ba12 + 31c48da commit b2fdf43
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .hgtags
Original file line number Diff line number Diff line change
Expand Up @@ -3085,3 +3085,5 @@ d42a1d3b74d40f580359dbd139d2d0dfa7235252 v7-4-353
761687c6808f4c9c80d33a919a6bb506dfe9f674 v7-4-360
a97e5b9dbc26800830e46cf3c1aa6efbfe258097 v7-4-361
7fa2bed947fde3514a700c96861a537d816d6fd4 v7-4-362
ff3816167b73fde35017d364b1a820014cd42e76 v7-4-363
7b324826757595b21b0410a7b6f00227d73c655f v7-4-364
13 changes: 8 additions & 5 deletions src/ex_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -2004,11 +2004,14 @@ write_viminfo(file, forceit)
{
fclose(fp_in);

/*
* In case of an error keep the original viminfo file.
* Otherwise rename the newly written file.
*/
if (viminfo_errcnt || vim_rename(tempname, fname) == -1)
/* In case of an error keep the original viminfo file. Otherwise
* rename the newly written file. Give an error if that fails. */
if (viminfo_errcnt == 0 && vim_rename(tempname, fname) == -1)
{
++viminfo_errcnt;
EMSG2(_("E886: Can't rename viminfo file to %s!"), fname);
}
if (viminfo_errcnt > 0)
mch_remove(tempname);

#ifdef WIN3264
Expand Down
28 changes: 24 additions & 4 deletions src/os_win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ win32_enable_privilege(LPTSTR lpszPrivilege, BOOL bEnable)
return FALSE;
}

tokenPrivileges.PrivilegeCount = 1;
tokenPrivileges.PrivilegeCount = 1;
tokenPrivileges.Privileges[0].Luid = luid;
tokenPrivileges.Privileges[0].Attributes = bEnable ?
SE_PRIVILEGE_ENABLED : 0;
Expand Down Expand Up @@ -1785,13 +1785,14 @@ mch_inchar(
#endif
{
int n = 1;
int conv = FALSE;

/* A key may have one or two bytes. */
typeahead[typeaheadlen] = c;
if (ch2 != NUL)
{
typeahead[typeaheadlen + 1] = ch2;
++n;
typeahead[typeaheadlen + 1] = 3;
typeahead[typeaheadlen + 2] = ch2;
n += 2;
}
#ifdef FEAT_MBYTE
/* Only convert normal characters, not special keys. Need to
Expand All @@ -1800,13 +1801,32 @@ mch_inchar(
if (input_conv.vc_type != CONV_NONE
&& (ch2 == NUL || c != K_NUL))
{
conv = TRUE;
typeaheadlen -= unconverted;
n = convert_input_safe(typeahead + typeaheadlen,
n + unconverted, TYPEAHEADLEN - typeaheadlen,
rest == NULL ? &rest : NULL, &restlen);
}
#endif

if (conv)
{
char_u *p = typeahead + typeaheadlen;
char_u *e = typeahead + TYPEAHEADLEN;

while (*p && p < e)
{
if (*p == K_NUL)
{
++p;
mch_memmove(p + 1, p, ((size_t)(e - p)) - 1);
*p = 3;
++n;
}
++p;
}
}

/* Use the ALT key to set the 8th bit of the character
* when it's one byte, the 8th bit isn't set yet and not
* using a double-byte encoding (would become a lead
Expand Down
13 changes: 13 additions & 0 deletions src/term.c
Original file line number Diff line number Diff line change
Expand Up @@ -3724,7 +3724,11 @@ add_termcode(name, string, flags)
return;
}

#if defined(WIN3264) && !defined(FEAT_GUI)
s = vim_strnsave(string, (int)STRLEN(string) + 1);
#else
s = vim_strsave(string);
#endif
if (s == NULL)
return;

Expand All @@ -3734,6 +3738,15 @@ add_termcode(name, string, flags)
STRMOVE(s, s + 1);
s[0] = term_7to8bit(string);
}

#if defined(WIN3264) && !defined(FEAT_GUI)
if (s[0] == K_NUL)
{
STRMOVE(s + 1, s);
s[1] = 3;
}
#endif

len = (int)STRLEN(s);

need_gather = TRUE; /* need to fill termleader[] */
Expand Down
4 changes: 4 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,10 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
364,
/**/
363,
/**/
362,
/**/
Expand Down

0 comments on commit b2fdf43

Please sign in to comment.