mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.2011: "syn sync" reports a very large number
Problem: "syn sync" reports a very large number. Solution: Use "at the first line".
This commit is contained in:
10
src/syntax.c
10
src/syntax.c
@@ -3868,10 +3868,15 @@ syn_cmd_list(
|
||||
if (curwin->w_s->b_syn_sync_minlines == 0)
|
||||
msg_puts(_("no syncing"));
|
||||
else
|
||||
{
|
||||
if (curwin->w_s->b_syn_sync_minlines == MAXLNUM)
|
||||
msg_puts(_("syncing starts at the first line"));
|
||||
else
|
||||
{
|
||||
msg_puts(_("syncing starts "));
|
||||
msg_outnum(curwin->w_s->b_syn_sync_minlines);
|
||||
msg_puts(_(" lines before top line"));
|
||||
}
|
||||
syn_match_msg();
|
||||
}
|
||||
return;
|
||||
@@ -3935,6 +3940,10 @@ syn_lines_msg(void)
|
||||
|| curwin->w_s->b_syn_sync_minlines > 0)
|
||||
{
|
||||
msg_puts("; ");
|
||||
if (curwin->w_s->b_syn_sync_minlines == MAXLNUM)
|
||||
msg_puts(_("from the first line"));
|
||||
else
|
||||
{
|
||||
if (curwin->w_s->b_syn_sync_minlines > 0)
|
||||
{
|
||||
msg_puts(_("minimal "));
|
||||
@@ -3949,6 +3958,7 @@ syn_lines_msg(void)
|
||||
}
|
||||
msg_puts(_(" lines before top line"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -316,6 +316,8 @@ func Test_syntax_arg_skipped()
|
||||
syn sync ccomment
|
||||
endif
|
||||
call assert_notmatch('on C-style comments', execute('syntax sync'))
|
||||
syn sync fromstart
|
||||
call assert_match('syncing starts at the first line', execute('syntax sync'))
|
||||
|
||||
syn clear
|
||||
endfunc
|
||||
@@ -735,6 +737,7 @@ func Test_syntax_foldlevel()
|
||||
redir END
|
||||
call assert_equal("\nsyntax foldlevel start", @c)
|
||||
syn sync fromstart
|
||||
call assert_match('from the first line$', execute('syn sync'))
|
||||
let a = map(range(3,9), 'foldclosed(v:val)')
|
||||
call assert_equal([3,3,3,3,3,3,3], a) " attached cascade folds together
|
||||
let a = map(range(10,15), 'foldclosed(v:val)')
|
||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
2011,
|
||||
/**/
|
||||
2010,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user