Compare commits

...

15 Commits

Author SHA1 Message Date
Bram Moolenaar
ae7ba984ee updated for version 7.3.367
Problem:    :wundo and :rundo use a wrong checksum.
Solution:   Include the last line when computing the hash. (Christian Brabandt)
2011-12-08 15:14:09 +01:00
Bram Moolenaar
0a11f8ce4e updated for version 7.3.366
Problem:    A tags file with an extremely long name causes errors.
Solution:   Ignore tags that are too long. (Arno Renevier)
2011-12-08 15:12:11 +01:00
Bram Moolenaar
f0b6b0cc3b updated for version 7.3.365
Problem:    Crash when using a large Unicode character in a file that has
            syntax highlighting. (ngollan)
Solution:   Check for going past the end of the utf tables. (Dominique Pelle)
2011-12-08 15:09:52 +01:00
Bram Moolenaar
2bbafdbcee updated for version 7.3.364
Problem:    Can't compile on HP-UX. (John Marriott)
Solution:   Only use TTYM_URXVT when it is defined.
2011-12-01 20:59:21 +01:00
Bram Moolenaar
3388bb4847 updated for version 7.3.363
Problem:    C indenting is wrong after #endif followed by a semicolon.
Solution:   Add special handling for a semicolon in a line by itself. (Lech
            Lorens)
2011-11-30 17:20:23 +01:00
Bram Moolenaar
0612ec8d53 updated for version 7.3.362
Problem:    ml_get error when using ":g" with folded lines.
Solution:   Adjust the line number for changed_lines(). (Christian Brabandt)
2011-11-30 17:01:58 +01:00
Bram Moolenaar
89c7122c05 updated for version 7.3.361
Problem:    Accessing memory after it is freed when EXITFREE is defined.
Solution:   Don't access curwin when firstwin is NULL. (Dominique Pelle)
2011-11-30 15:40:56 +01:00
Bram Moolenaar
8000baffa7 updated for version 7.3.360
Problem:    Interrupting the load of an autoload function may cause a crash.
Solution:   Do not use the hashitem when not valid. (Yukihiro Nakadaira)
2011-11-30 15:19:28 +01:00
Bram Moolenaar
195ea0ff6c updated for version 7.3.359
Problem:    Command line completion shows dict functions.
Solution:   Skip dict functions for completion. (Yasuhiro Matsumoto)
2011-11-30 14:57:31 +01:00
Bram Moolenaar
b491c03ee7 updated for version 7.3.358
Problem:    Mouse support doesn't work properly.
Solution:   Add HMT_URXVT. (lilydjwg, James McCoy)
2011-11-30 14:47:15 +01:00
Bram Moolenaar
26fdd7da96 updated for version 7.3.357
Problem:    Compiler warning in MS-Windows console build.
Solution:   Adjust return type of PrintHookProc(). (Mike Williams)
2011-11-30 13:42:44 +01:00
Bram Moolenaar
6d8f9c6f59 updated for version 7.3.356
Problem:    Using "o" with 'cindent' set may freeze Vim. (lolilolicon)
Solution:   Skip over {} correctly. (Hari G)
2011-11-30 13:03:28 +01:00
Bram Moolenaar
49e4ec6eee updated for version 7.3.355
Problem:    GTK warnings when using netrw.vim. (Ivan Krasilnikov)
Solution:   Do not remove the beval event handler twice.
2011-11-30 11:31:30 +01:00
Bram Moolenaar
4e5ccfa5c7 updated for version 7.3.354
Problem:    ":set backspace+=eol" doesn't work when 'backspace' has a
            backwards compatible value of 2.
Solution:   Convert the number to a string. (Hirohito Higashi)
2011-11-30 11:15:47 +01:00
Bram Moolenaar
1dff76bcb8 updated for version 7.3.353
Problem:    Missing part of the urxvt patch.
Solution:   Add the change in term.c
2011-10-26 23:48:20 +02:00
13 changed files with 235 additions and 22 deletions

View File

@@ -567,8 +567,9 @@ buf_freeall(buf, flags)
diff_buf_delete(buf); /* Can't use 'diff' for unloaded buffer. */
#endif
#ifdef FEAT_SYN_HL
if (curwin->w_buffer == buf)
reset_synblock(curwin); /* remove any ownsyntax */
/* Remove any ownsyntax, unless exiting. */
if (firstwin != NULL && curwin->w_buffer == buf)
reset_synblock(curwin);
#endif
#ifdef FEAT_FOLDING

View File

@@ -875,7 +875,7 @@ eval_init()
#ifdef EBCDIC
/*
* Sort the function table, to enable binary sort.
* Sort the function table, to enable binary search.
*/
sortFunctions();
#endif
@@ -19589,9 +19589,14 @@ find_var_in_ht(ht, varname, writing)
* worked find the variable again. Don't auto-load a script if it was
* loaded already, otherwise it would be loaded every time when
* checking if a function name is a Funcref variable. */
if (ht == &globvarht && !writing
&& script_autoload(varname, FALSE) && !aborting())
if (ht == &globvarht && !writing)
{
/* Note: script_autoload() may make "hi" invalid. It must either
* be obtained again or not used. */
if (!script_autoload(varname, FALSE) || aborting())
return NULL;
hi = hash_find(ht, varname);
}
if (HASHITEM_EMPTY(hi))
return NULL;
}
@@ -21737,6 +21742,9 @@ get_user_func_name(xp, idx)
++hi;
fp = HI2UF(hi);
if (fp->uf_flags & FC_DICT)
return NULL; /* don't show dict functions */
if (STRLEN(fp->uf_name) + 4 >= IOSIZE)
return fp->uf_name; /* prevents overflow */

View File

@@ -820,7 +820,13 @@ do_move(line1, line2, dest)
curwin->w_cursor.lnum = dest + (line2 - line1) + 1;
if (line1 < dest)
changed_lines(line1, 0, dest + num_lines + 1, 0L);
{
dest += num_lines + 1;
last_line = curbuf->b_ml.ml_line_count;
if (dest > last_line + 1)
dest = last_line + 1;
changed_lines(line1, 0, dest, 0L);
}
else
changed_lines(dest + 1, 0, line1 + num_lines, 0L);

View File

@@ -2764,19 +2764,22 @@ utf_convert(a, table, tableSize)
int tableSize;
{
int start, mid, end; /* indices into table */
int entries = tableSize / sizeof(convertStruct);
start = 0;
end = tableSize / sizeof(convertStruct);
end = entries;
while (start < end)
{
/* need to search further */
mid = (end + start) /2;
mid = (end + start) / 2;
if (table[mid].rangeEnd < a)
start = mid + 1;
else
end = mid;
}
if (table[start].rangeStart <= a && a <= table[start].rangeEnd
if (start < entries
&& table[start].rangeStart <= a
&& a <= table[start].rangeEnd
&& (a - table[start].rangeStart) % table[start].step == 0)
return (a + table[start].offset);
else
@@ -2791,7 +2794,7 @@ utf_convert(a, table, tableSize)
utf_fold(a)
int a;
{
return utf_convert(a, foldCase, sizeof(foldCase));
return utf_convert(a, foldCase, (int)sizeof(foldCase));
}
static convertStruct toLower[] =
@@ -3119,7 +3122,7 @@ utf_toupper(a)
return TOUPPER_LOC(a);
/* For any other characters use the above mapping table. */
return utf_convert(a, toUpper, sizeof(toUpper));
return utf_convert(a, toUpper, (int)sizeof(toUpper));
}
int
@@ -3152,7 +3155,7 @@ utf_tolower(a)
return TOLOWER_LOC(a);
/* For any other characters use the above mapping table. */
return utf_convert(a, toLower, sizeof(toLower));
return utf_convert(a, toLower, (int)sizeof(toLower));
}
int

View File

@@ -6127,7 +6127,7 @@ corr_ind_maxparen(ind_maxparen, startpos)
/*
* Set w_cursor.col to the column number of the last unmatched ')' or '{' in
* line "l".
* line "l". "l" must point to the start of the line.
*/
static int
find_last_paren(l, start, end)
@@ -6140,7 +6140,7 @@ find_last_paren(l, start, end)
curwin->w_cursor.col = 0; /* default is start of line */
for (i = 0; l[i]; i++)
for (i = 0; l[i] != NUL; i++)
{
i = (int)(cin_skipcomment(l + i) - l); /* ignore parens in comments */
i = (int)(skip_string(l + i) - l); /* ignore parens in quotes */
@@ -7953,6 +7953,7 @@ term_again:
* If we're at the end of a block, skip to the start of
* that block.
*/
l = ml_get_curline();
if (find_last_paren(l, '{', '}')
&& (trypos = find_start_brace(ind_maxcomment))
!= NULL) /* XXX */
@@ -8141,6 +8142,29 @@ term_again:
if (cin_ends_in(l, (char_u *)"};", NULL))
break;
/*
* Find a line only has a semicolon that belongs to a previous
* line ending in '}', e.g. before an #endif. Don't increase
* indent then.
*/
if (*(look = skipwhite(l)) == ';' && cin_nocode(look + 1))
{
pos_T curpos_save = curwin->w_cursor;
while (curwin->w_cursor.lnum > 1)
{
look = ml_get(--curwin->w_cursor.lnum);
if (!(cin_nocode(look) || cin_ispreproc_cont(
&look, &curwin->w_cursor.lnum)))
break;
}
if (curwin->w_cursor.lnum > 0
&& cin_ends_in(look, (char_u *)"}", NULL))
break;
curwin->w_cursor = curpos_save;
}
/*
* If the PREVIOUS line is a function declaration, the current
* line (and the ones that follow) needs to be indented as

View File

@@ -4566,6 +4566,31 @@ do_set(arg, opt_flags)
save_arg = arg;
arg = errbuf;
}
/*
* Convert 'backspace' number to string, for
* adding, prepending and removing string.
*/
else if (varp == (char_u *)&p_bs
&& VIM_ISDIGIT(**(char_u **)varp))
{
i = getdigits((char_u **)varp);
switch (i)
{
case 0:
*(char_u **)varp = empty_option;
break;
case 1:
*(char_u **)varp = vim_strsave(
(char_u *)"indent,eol");
break;
case 2:
*(char_u **)varp = vim_strsave(
(char_u *)"indent,eol,start");
break;
}
vim_free(oldval);
oldval = *(char_u **)varp;
}
/*
* Convert 'whichwrap' number to string, for
* backwards compatibility with Vim 3.0.
@@ -7771,9 +7796,9 @@ set_bool_option(opt_idx, varp, value, opt_flags)
#ifdef FEAT_BEVAL
else if ((int *)varp == &p_beval)
{
if (p_beval == TRUE)
if (p_beval && !old_value)
gui_mch_enable_beval_area(balloonEval);
else
else if (!p_beval && old_value)
gui_mch_disable_beval_area(balloonEval);
}
#endif

View File

@@ -1869,7 +1869,7 @@ AbortProc(HDC hdcPrn, int iCode)
#ifndef FEAT_GUI
static UINT CALLBACK
static UINT_PTR CALLBACK
PrintHookProc(
HWND hDlg, // handle to dialog box
UINT uiMsg, // message identifier

View File

@@ -1906,12 +1906,26 @@ line_read_in:
tagp.tagname = lbuf;
#ifdef FEAT_TAG_ANYWHITE
tagp.tagname_end = skiptowhite(lbuf);
if (*tagp.tagname_end == NUL) /* corrupted tag line */
if (*tagp.tagname_end == NUL)
#else
tagp.tagname_end = vim_strchr(lbuf, TAB);
if (tagp.tagname_end == NULL) /* corrupted tag line */
if (tagp.tagname_end == NULL)
#endif
{
if (vim_strchr(lbuf, NL) == NULL)
{
/* Truncated line, ignore it. Has been reported for
* Mozilla JS with extremely long names. */
if (p_verbose >= 5)
{
verbose_enter();
MSG(_("Ignoring long line in tags file"));
verbose_leave();
}
continue;
}
/* Corrupted tag line. */
line_error = TRUE;
break;
}

View File

@@ -1996,6 +1996,7 @@ set_termname(term)
# define HMT_DEC 4
# define HMT_JSBTERM 8
# define HMT_PTERM 16
# define HMT_URXVT 32
static int has_mouse_termcode = 0;
# endif
@@ -2030,6 +2031,11 @@ set_mouse_termcode(n, s)
if (n == KS_PTERM_MOUSE)
has_mouse_termcode |= HMT_PTERM;
else
# endif
# ifdef FEAT_MOUSE_URXVT
if (n == KS_URXVT_MOUSE)
has_mouse_termcode |= HMT_URXVT;
else
# endif
has_mouse_termcode |= HMT_NORMAL;
# endif
@@ -2067,6 +2073,11 @@ del_mouse_termcode(n)
if (n == KS_PTERM_MOUSE)
has_mouse_termcode &= ~HMT_PTERM;
else
# endif
# ifdef FEAT_MOUSE_URXVT
if (n == KS_URXVT_MOUSE)
has_mouse_termcode &= ~HMT_URXVT;
else
# endif
has_mouse_termcode &= ~HMT_NORMAL;
# endif
@@ -4008,7 +4019,9 @@ check_termcode(max_offset, buf, buflen)
}
#ifdef FEAT_TERMRESPONSE
if (key_name[0] == NUL)
if (key_name[0] == NUL
/* URXVT mouse uses <ESC>[#;#;#M, but we are matching <ESC>[ */
|| key_name[0] == KS_URXVT_MOUSE)
{
/* Check for xterm version string: "<Esc>[>{x};{vers};{y}c". Also
* eat other possible responses to t_RV, rxvt returns
@@ -4047,7 +4060,11 @@ check_termcode(max_offset, buf, buflen)
if (tp[1 + (tp[0] != CSI)] == '>' && j == 2)
{
/* if xterm version >= 95 use mouse dragging */
if (extra >= 95)
if (extra >= 95
# ifdef TTYM_URXVT
&& ttym_flags != TTYM_URXVT
# endif
)
set_option_value((char_u *)"ttym", 0L,
(char_u *)"xterm2", 0);
/* if xterm version >= 141 try to get termcap codes */
@@ -4140,6 +4157,9 @@ check_termcode(max_offset, buf, buflen)
# endif
# ifdef FEAT_MOUSE_PTERM
|| key_name[0] == (int)KS_PTERM_MOUSE
# endif
# ifdef FEAT_MOUSE_URXVT
|| key_name[0] == (int)KS_URXVT_MOUSE
# endif
)
{
@@ -4219,7 +4239,69 @@ check_termcode(max_offset, buf, buflen)
else
break;
}
}
# ifdef FEAT_MOUSE_URXVT
if (key_name[0] == (int)KS_URXVT_MOUSE)
{
for (;;)
{
/* URXVT 1015 mouse reporting mode:
* Almost identical to xterm mouse mode, except the values
* are decimal instead of bytes.
*
* \033[%d;%d;%dM
* ^-- row
* ^----- column
* ^-------- code
*/
p = tp + slen;
mouse_code = getdigits(&p);
if (*p++ != ';')
return -1;
mouse_col = getdigits(&p) - 1;
if (*p++ != ';')
return -1;
mouse_row = getdigits(&p) - 1;
if (*p++ != 'M')
return -1;
slen += (int)(p - (tp + slen));
/* skip this one if next one has same code (like xterm
* case) */
j = termcodes[idx].len;
if (STRNCMP(tp, tp + slen, (size_t)j) == 0) {
/* check if the command is complete by looking for the
* M */
int slen2;
int cmd_complete = 0;
for (slen2 = slen; slen2 < len; slen2++) {
if (tp[slen2] == 'M') {
cmd_complete = 1;
break;
}
}
p += j;
if (cmd_complete && getdigits(&p) == mouse_code) {
slen += j; /* skip the \033[ */
continue;
}
}
break;
}
}
# endif
if (key_name[0] == (int)KS_MOUSE
#ifdef FEAT_MOUSE_URXVT
|| key_name[0] == (int)KS_URXVT_MOUSE
#endif
)
{
# if !defined(MSWIN) && !defined(MSDOS)
/*
* Handle mouse events.

View File

@@ -1454,6 +1454,16 @@ void func2(void)
int tab[] =
{1, 2,
3, 4,
5, 6};
printf("This line used to be indented incorrectly.\n");
}
int foo[]
#ifdef BAR
= { 1, 2, 3,
4, 5, 6 }
#endif
;

View File

@@ -1307,6 +1307,16 @@ void func2(void)
printf("This line used to be indented incorrectly.\n");
}
int foo[]
#ifdef BAR
= { 1, 2, 3,
4, 5, 6 }
#endif
;
int baz;
void func3(void)
{
int tab[] = {

View File

@@ -719,7 +719,7 @@ u_compute_hash(hash)
char_u *p;
sha256_start(&ctx);
for (lnum = 1; lnum < curbuf->b_ml.ml_line_count; ++lnum)
for (lnum = 1; lnum <= curbuf->b_ml.ml_line_count; ++lnum)
{
p = ml_get(lnum);
sha256_update(&ctx, p, (UINT32_T)(STRLEN(p) + 1));

View File

@@ -714,6 +714,36 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
367,
/**/
366,
/**/
365,
/**/
364,
/**/
363,
/**/
362,
/**/
361,
/**/
360,
/**/
359,
/**/
358,
/**/
357,
/**/
356,
/**/
355,
/**/
354,
/**/
353,
/**/
352,
/**/