mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
Merge remote-tracking branch 'vim/master'
This commit is contained in:
+1
-1
@@ -12456,7 +12456,7 @@ f_timer_start(typval_T *argvars, typval_T *rettv)
|
||||
free_callback(callback, partial);
|
||||
else
|
||||
{
|
||||
if (timer->tr_partial == NULL)
|
||||
if (partial == NULL)
|
||||
timer->tr_callback = vim_strsave(callback);
|
||||
else
|
||||
/* pointer into the partial */
|
||||
|
||||
+2
-1
@@ -1143,10 +1143,11 @@ free_timer(timer_T *timer)
|
||||
create_timer(long msec, int repeat)
|
||||
{
|
||||
timer_T *timer = (timer_T *)alloc_clear(sizeof(timer_T));
|
||||
long prev_id = last_timer_id;
|
||||
|
||||
if (timer == NULL)
|
||||
return NULL;
|
||||
if (++last_timer_id < 0)
|
||||
if (++last_timer_id <= prev_id)
|
||||
/* Overflow! Might cause duplicates... */
|
||||
last_timer_id = 0;
|
||||
timer->tr_id = last_timer_id;
|
||||
|
||||
+8
-2
@@ -6103,7 +6103,7 @@ cin_isterminated(
|
||||
* When a line ends in a comma we continue looking in the next line.
|
||||
* "sp" points to a string with the line. When looking at other lines it must
|
||||
* be restored to the line. When it's NULL fetch lines here.
|
||||
* "lnum" is where we start looking.
|
||||
* "first_lnum" is where we start looking.
|
||||
* "min_lnum" is the line before which we will not be looking.
|
||||
*/
|
||||
static int
|
||||
@@ -6114,6 +6114,7 @@ cin_isfuncdecl(
|
||||
{
|
||||
char_u *s;
|
||||
linenr_T lnum = first_lnum;
|
||||
linenr_T save_lnum = curwin->w_cursor.lnum;
|
||||
int retval = FALSE;
|
||||
pos_T *trypos;
|
||||
int just_started = TRUE;
|
||||
@@ -6123,15 +6124,20 @@ cin_isfuncdecl(
|
||||
else
|
||||
s = *sp;
|
||||
|
||||
curwin->w_cursor.lnum = lnum;
|
||||
if (find_last_paren(s, '(', ')')
|
||||
&& (trypos = find_match_paren(curbuf->b_ind_maxparen)) != NULL)
|
||||
{
|
||||
lnum = trypos->lnum;
|
||||
if (lnum < min_lnum)
|
||||
{
|
||||
curwin->w_cursor.lnum = save_lnum;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
s = ml_get(lnum);
|
||||
}
|
||||
curwin->w_cursor.lnum = save_lnum;
|
||||
|
||||
/* Ignore line starting with #. */
|
||||
if (cin_ispreproc(s))
|
||||
@@ -6687,7 +6693,7 @@ find_start_brace(void) /* XXX */
|
||||
static pos_T *
|
||||
find_match_paren(int ind_maxparen) /* XXX */
|
||||
{
|
||||
return find_match_char('(', ind_maxparen);
|
||||
return find_match_char('(', ind_maxparen);
|
||||
}
|
||||
|
||||
static pos_T *
|
||||
|
||||
@@ -48,12 +48,12 @@ endfunc
|
||||
|
||||
func Test_with_partial_callback()
|
||||
let g:val = 0
|
||||
let s:meow = {}
|
||||
function s:meow.bite(...)
|
||||
let g:val += 1
|
||||
let meow = {'one': 1}
|
||||
function meow.bite(...)
|
||||
let g:val += self.one
|
||||
endfunction
|
||||
|
||||
call timer_start(50, s:meow.bite)
|
||||
call timer_start(50, meow.bite)
|
||||
let slept = WaitFor('g:val == 1')
|
||||
call assert_equal(1, g:val)
|
||||
if has('reltime')
|
||||
|
||||
@@ -778,6 +778,12 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
2361,
|
||||
/**/
|
||||
2360,
|
||||
/**/
|
||||
2359,
|
||||
/**/
|
||||
2358,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user