1
0
forked from aniani/vim

updated for version 7.0138

This commit is contained in:
Bram Moolenaar
2005-08-29 22:25:38 +00:00
parent 81f1ecbc4d
commit ac6e65f88d
30 changed files with 954 additions and 381 deletions

View File

@@ -2706,17 +2706,37 @@ mb_prevptr(line, p)
mb_charlen(str)
char_u *str;
{
int count;
char_u *p = str;
int count;
if (str == NULL)
if (p == NULL)
return 0;
for (count = 0; *str != NUL; count++)
str += (*mb_ptr2len)(str);
for (count = 0; *p != NUL; count++)
p += (*mb_ptr2len)(p);
return count;
}
#if defined(FEAT_SYN_HL) || defined(PROTO)
/*
* Like mb_charlen() but for a string with specified length.
*/
int
mb_charlen_len(str, len)
char_u *str;
int len;
{
char_u *p = str;
int count;
for (count = 0; *p != NUL && p < str + len; count++)
p += (*mb_ptr2len)(p);
return count;
}
#endif
/*
* Try to un-escape a multi-byte character.
* Used for the "to" and "from" part of a mapping.