Compare commits

..

7 Commits

Author SHA1 Message Date
Bram Moolenaar
8dd7901a66 updated for version 7.3.985
Problem:    GTK vim not started as gvim doesn't set WM_CLASS property to a
            useful value.
Solution:   Call g_set_prgname() on startup. (James McCoy)
2013-05-21 12:52:04 +02:00
Bram Moolenaar
9bad29decf updated for version 7.3.984
Problem:    A Visual mapping that uses CTRL-G works differently when started
            from Insert mode. (Ein Brown)
Solution:   Reset old_mapped_len when handling typed text in Select mode.
2013-05-21 12:46:02 +02:00
Bram Moolenaar
080504921d updated for version 7.3.983
Problem:    Uneccessary temp variable.
Solution:   Remove the variable.
2013-05-21 12:43:56 +02:00
Bram Moolenaar
0fabe3fdbe updated for version 7.3.982
Problem:    In the new regexp engine \p does not work on multi-byte
            characters.
Solution:   Don't point to an integer but the characters.
2013-05-21 12:34:17 +02:00
Bram Moolenaar
09ea9fcf3f updated for version 7.3.981
Problem:    In the old regexp engine \i, \I, \f and \F don't work on
            multi-byte characters.
Solution:   Dereference pointer properly.
2013-05-21 00:03:02 +02:00
Bram Moolenaar
745fc029ba updated for version 7.3.980
Problem:    Regexp logs may contain garbage. Character classes don't work
            correctly for multi-byte characters.
Solution:   Check for end of post list.  Only use "is" functions for
            characters up to 255. (Ken Takata)
2013-05-20 22:20:02 +02:00
Bram Moolenaar
e3c7b86aab updated for version 7.3.979
Problem:    Complex NFA regexp doesn't work.
Solution:   Set actual state stack end instead of using an arbitrary number.
            (Yasuhiro Matsumoto)
2013-05-20 21:57:03 +02:00
9 changed files with 48 additions and 20 deletions

View File

@@ -1447,6 +1447,11 @@ gui_mch_init_check(void)
using_gnome = 1;
#endif
/* This defaults to argv[0], but we want it to match the name of the
* shipped gvim.desktop so that Vim's windows can be associated with this
* file. */
g_set_prgname("gvim");
/* Don't use gtk_init() or gnome_init(), it exits on failure. */
if (!gtk_init_check(&gui_argc, &gui_argv))
{

View File

@@ -701,6 +701,7 @@ normal_cmd(oap, toplevel)
else
c = 'c';
msg_nowait = TRUE; /* don't delay going to insert mode */
old_mapped_len = 0; /* do go to Insert mode */
}
#endif

View File

@@ -5758,7 +5758,7 @@ regrepeat(p, maxcount)
case SIDENT + ADD_NL:
while (count < maxcount)
{
if (vim_isIDc(*scan) && (testval || !VIM_ISDIGIT(*scan)))
if (vim_isIDc(PTR2CHAR(scan)) && (testval || !VIM_ISDIGIT(*scan)))
{
mb_ptr_adv(scan);
}
@@ -5819,7 +5819,7 @@ regrepeat(p, maxcount)
case SFNAME + ADD_NL:
while (count < maxcount)
{
if (vim_isfilec(*scan) && (testval || !VIM_ISDIGIT(*scan)))
if (vim_isfilec(PTR2CHAR(scan)) && (testval || !VIM_ISDIGIT(*scan)))
{
mb_ptr_adv(scan);
}

View File

@@ -17,8 +17,6 @@
#define NFA_BRACES_MAXLIMIT 10
/* For allocating space for the postfix representation */
#define NFA_POSTFIX_MULTIPLIER (NFA_BRACES_MAXLIMIT + 2)*2
/* Size of stack, used when converting the postfix regexp into NFA */
#define NFA_STACK_SIZE 1024
enum
{
@@ -1828,13 +1826,13 @@ nfa_postfix_dump(expr, retval)
else if (retval == OK)
fprintf(f, ">>> NFA engine succeeded !\n");
fprintf(f, "Regexp: \"%s\"\nPostfix notation (char): \"", expr);
for (p=post_start; *p; p++)
for (p = post_start; *p && p < post_end; p++)
{
nfa_set_code(*p);
fprintf(f, "%s, ", code);
}
fprintf(f, "\"\nPostfix notation (int): ");
for (p=post_start; *p; p++)
for (p = post_start; *p && p < post_end; p++)
fprintf(f, "%d ", *p);
fprintf(f, "\n\n");
fclose(f);
@@ -2160,9 +2158,9 @@ post2nfa(postfix, end, nfa_calc_size)
if (nfa_calc_size == FALSE)
{
/* Allocate space for the stack. Max states on the stack : nstate */
stack = (Frag_T *) lalloc((nstate + 1)*sizeof(Frag_T), TRUE);
stack = (Frag_T *) lalloc((nstate + 1) * sizeof(Frag_T), TRUE);
stackp = stack;
stack_end = stack + NFA_STACK_SIZE;
stack_end = stack + (nstate + 1);
}
for (p = postfix; p < end; ++p)
@@ -2669,11 +2667,11 @@ check_char_class(class, c)
switch (class)
{
case NFA_CLASS_ALNUM:
if (isalnum(c))
if (c >= 1 && c <= 255 && isalnum(c))
return OK;
break;
case NFA_CLASS_ALPHA:
if (isalpha(c))
if (c >= 1 && c <= 255 && isalpha(c))
return OK;
break;
case NFA_CLASS_BLANK:
@@ -2681,7 +2679,7 @@ check_char_class(class, c)
return OK;
break;
case NFA_CLASS_CNTRL:
if (iscntrl(c))
if (c >= 1 && c <= 255 && iscntrl(c))
return OK;
break;
case NFA_CLASS_DIGIT:
@@ -2689,7 +2687,7 @@ check_char_class(class, c)
return OK;
break;
case NFA_CLASS_GRAPH:
if (isgraph(c))
if (c >= 1 && c <= 255 && isgraph(c))
return OK;
break;
case NFA_CLASS_LOWER:
@@ -2701,7 +2699,7 @@ check_char_class(class, c)
return OK;
break;
case NFA_CLASS_PUNCT:
if (ispunct(c))
if (c >= 1 && c <= 255 && ispunct(c))
return OK;
break;
case NFA_CLASS_SPACE:
@@ -2835,7 +2833,6 @@ nfa_regmatch(start, submatch, m)
int old_reglnum = -1;
int reginput_updated = FALSE;
thread_T *t;
char_u *cc;
char_u *old_reginput = NULL;
char_u *old_regline = NULL;
nfa_state_T *sta;
@@ -2933,7 +2930,6 @@ again:
}
if (c == NUL)
n = 0;
cc = (char_u *)&c;
/* swap lists */
thislist = &list[flag];
@@ -2962,7 +2958,7 @@ again:
if (neglist->n > 0)
{
t = &neglist->t[0];
neglist->n --;
neglist->n--;
i--;
}
else
@@ -3263,12 +3259,12 @@ again:
break;
case NFA_KWORD: /* \k */
result = vim_iswordp(cc);
result = vim_iswordp(reginput);
ADD_POS_NEG_STATE(t->state);
break;
case NFA_SKWORD: /* \K */
result = !VIM_ISDIGIT(c) && vim_iswordp(cc);
result = !VIM_ISDIGIT(c) && vim_iswordp(reginput);
ADD_POS_NEG_STATE(t->state);
break;
@@ -3283,12 +3279,12 @@ again:
break;
case NFA_PRINT: /* \p */
result = ptr2cells(cc) == 1;
result = ptr2cells(reginput) == 1;
ADD_POS_NEG_STATE(t->state);
break;
case NFA_SPRINT: /* \P */
result = !VIM_ISDIGIT(c) && ptr2cells(cc) == 1;
result = !VIM_ISDIGIT(c) && ptr2cells(reginput) == 1;
ADD_POS_NEG_STATE(t->state);
break;

View File

@@ -262,6 +262,10 @@ STARTTEST
:call add(tl, ['[a-zA-Z]', 'a', 'a'])
:call add(tl, ['[A-Z]', 'a'])
:call add(tl, ['\C[^A-Z]\+', 'ABCOIJDEOIFNSD jsfoij sa', ' jsfoij sa'])
:call add(tl, ['\i\+', '&*§xx ', 'xx'])
:call add(tl, ['\%#=1\i\+', '&*§xx ', 'xx'])
:call add(tl, ['\f\+', '&*Ÿfname ', 'fname'])
:call add(tl, ['\%#=1\i\+', '&*Ÿfname ', 'fname'])
:"""" Tests for \z features
:call add(tl, ['xx \ze test', 'xx ']) " must match after \ze

View File

@@ -203,6 +203,10 @@ OK - [a-z]
OK - [a-zA-Z]
OK - [A-Z]
OK - \C[^A-Z]\+
OK - \i\+
OK - \%#=1\i\+
OK - \f\+
OK - \%#=1\i\+
OK - xx \ze test
OK - abc\zeend
OK - abc\zsdd

View File

@@ -25,6 +25,9 @@ STARTTEST
:call add(tl, [' [^ ]\+', 'start มabcdม ', ' มabcdม'])
:call add(tl, ['[ม[:alpha:][=a=]]\+', '879 aiaãมâมaiuvna ', 'aiaãมâมaiuvna'])
:" this is not a normal "i" but 0xec
:call add(tl, ['\p\+', 'ìa', 'ìa'])
:"""" Run the tests
:"

View File

@@ -4,3 +4,4 @@ OK - [[=a=]]\+
OK - [^ม ]\+
OK - [^ ]\+
OK - [ม[:alpha:][=a=]]\+
OK - \p\+

View File

@@ -728,6 +728,20 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
985,
/**/
984,
/**/
983,
/**/
982,
/**/
981,
/**/
980,
/**/
979,
/**/
978,
/**/