mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
vim-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".
9950280d37
This commit is contained in:
@@ -3505,12 +3505,16 @@ syn_cmd_list(
|
|||||||
syn_match_msg();
|
syn_match_msg();
|
||||||
return;
|
return;
|
||||||
} else if (!(curwin->w_s->b_syn_sync_flags & SF_MATCH)) {
|
} else if (!(curwin->w_s->b_syn_sync_flags & SF_MATCH)) {
|
||||||
if (curwin->w_s->b_syn_sync_minlines == 0)
|
if (curwin->w_s->b_syn_sync_minlines == 0) {
|
||||||
MSG_PUTS(_("no syncing"));
|
MSG_PUTS(_("no syncing"));
|
||||||
else {
|
} else {
|
||||||
MSG_PUTS(_("syncing starts "));
|
if (curwin->w_s->b_syn_sync_minlines == MAXLNUM) {
|
||||||
msg_outnum(curwin->w_s->b_syn_sync_minlines);
|
MSG_PUTS(_("syncing starts at the first line"));
|
||||||
MSG_PUTS(_(" lines before top line"));
|
} else {
|
||||||
|
MSG_PUTS(_("syncing starts "));
|
||||||
|
msg_outnum(curwin->w_s->b_syn_sync_minlines);
|
||||||
|
MSG_PUTS(_(" lines before top line"));
|
||||||
|
}
|
||||||
syn_match_msg();
|
syn_match_msg();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -3566,17 +3570,22 @@ static void syn_lines_msg(void)
|
|||||||
if (curwin->w_s->b_syn_sync_maxlines > 0
|
if (curwin->w_s->b_syn_sync_maxlines > 0
|
||||||
|| curwin->w_s->b_syn_sync_minlines > 0) {
|
|| curwin->w_s->b_syn_sync_minlines > 0) {
|
||||||
MSG_PUTS("; ");
|
MSG_PUTS("; ");
|
||||||
if (curwin->w_s->b_syn_sync_minlines > 0) {
|
if (curwin->w_s->b_syn_sync_minlines == MAXLNUM) {
|
||||||
MSG_PUTS(_("minimal "));
|
MSG_PUTS(_("from the first line"));
|
||||||
msg_outnum(curwin->w_s->b_syn_sync_minlines);
|
} else {
|
||||||
if (curwin->w_s->b_syn_sync_maxlines)
|
if (curwin->w_s->b_syn_sync_minlines > 0) {
|
||||||
MSG_PUTS(", ");
|
MSG_PUTS(_("minimal "));
|
||||||
|
msg_outnum(curwin->w_s->b_syn_sync_minlines);
|
||||||
|
if (curwin->w_s->b_syn_sync_maxlines) {
|
||||||
|
MSG_PUTS(", ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (curwin->w_s->b_syn_sync_maxlines > 0) {
|
||||||
|
MSG_PUTS(_("maximal "));
|
||||||
|
msg_outnum(curwin->w_s->b_syn_sync_maxlines);
|
||||||
|
}
|
||||||
|
MSG_PUTS(_(" lines before top line"));
|
||||||
}
|
}
|
||||||
if (curwin->w_s->b_syn_sync_maxlines > 0) {
|
|
||||||
MSG_PUTS(_("maximal "));
|
|
||||||
msg_outnum(curwin->w_s->b_syn_sync_maxlines);
|
|
||||||
}
|
|
||||||
MSG_PUTS(_(" lines before top line"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -308,6 +308,8 @@ func Test_syntax_arg_skipped()
|
|||||||
syn sync ccomment
|
syn sync ccomment
|
||||||
endif
|
endif
|
||||||
call assert_notmatch('on C-style comments', execute('syntax sync'))
|
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
|
syn clear
|
||||||
endfunc
|
endfunc
|
||||||
@@ -669,6 +671,7 @@ func Test_syntax_foldlevel()
|
|||||||
redir END
|
redir END
|
||||||
call assert_equal("\nsyntax foldlevel start", @c)
|
call assert_equal("\nsyntax foldlevel start", @c)
|
||||||
syn sync fromstart
|
syn sync fromstart
|
||||||
|
call assert_match('from the first line$', execute('syn sync'))
|
||||||
let a = map(range(3,9), 'foldclosed(v:val)')
|
let a = map(range(3,9), 'foldclosed(v:val)')
|
||||||
call assert_equal([3,3,3,3,3,3,3], a) " attached cascade folds together
|
call assert_equal([3,3,3,3,3,3,3], a) " attached cascade folds together
|
||||||
let a = map(range(10,15), 'foldclosed(v:val)')
|
let a = map(range(10,15), 'foldclosed(v:val)')
|
||||||
|
Reference in New Issue
Block a user