aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/syntax.c39
-rw-r--r--src/nvim/testdir/test_filetype.vim1
-rw-r--r--src/nvim/testdir/test_syntax.vim3
3 files changed, 28 insertions, 15 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index 2e593e39de..5e54354ea8 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -3505,12 +3505,16 @@ syn_cmd_list(
syn_match_msg();
return;
} 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"));
- else {
- MSG_PUTS(_("syncing starts "));
- msg_outnum(curwin->w_s->b_syn_sync_minlines);
- MSG_PUTS(_(" lines before top line"));
+ } 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;
@@ -3566,17 +3570,22 @@ static void syn_lines_msg(void)
if (curwin->w_s->b_syn_sync_maxlines > 0
|| curwin->w_s->b_syn_sync_minlines > 0) {
MSG_PUTS("; ");
- if (curwin->w_s->b_syn_sync_minlines > 0) {
- 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);
+ 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 "));
+ 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"));
}
- MSG_PUTS(_(" lines before top line"));
}
}
diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim
index 9f7e153955..af8482bdbe 100644
--- a/src/nvim/testdir/test_filetype.vim
+++ b/src/nvim/testdir/test_filetype.vim
@@ -329,6 +329,7 @@ let s:filename_checks = {
\ 'papp': ['file.papp', 'file.pxml', 'file.pxsl'],
\ 'pascal': ['file.pas', 'file.pp', 'file.dpr', 'file.lpr'],
\ 'passwd': ['any/etc/passwd', 'any/etc/passwd-', 'any/etc/passwd.edit', 'any/etc/shadow', 'any/etc/shadow-', 'any/etc/shadow.edit', 'any/var/backups/passwd.bak', 'any/var/backups/shadow.bak'],
+ \ 'pbtxt': ['file.pbtxt'],
\ 'pccts': ['file.g'],
\ 'pdf': ['file.pdf'],
\ 'perl': ['file.plx', 'file.al', 'file.psgi', 'gitolite.rc', '.gitolite.rc', 'example.gitolite.rc'],
diff --git a/src/nvim/testdir/test_syntax.vim b/src/nvim/testdir/test_syntax.vim
index 2617aa3945..4cf0e983b0 100644
--- a/src/nvim/testdir/test_syntax.vim
+++ b/src/nvim/testdir/test_syntax.vim
@@ -308,6 +308,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
@@ -669,6 +671,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)')