diff options
-rw-r--r-- | runtime/filetype.vim | 6 | ||||
-rw-r--r-- | src/nvim/search.c | 7 | ||||
-rw-r--r-- | src/nvim/tag.c | 17 | ||||
-rw-r--r-- | src/nvim/testdir/runtest.vim | 2 | ||||
-rw-r--r-- | src/nvim/testdir/test_alot.vim | 1 | ||||
-rw-r--r-- | src/nvim/testdir/test_filetype.vim | 3 |
6 files changed, 25 insertions, 11 deletions
diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 6abf9da55f..8ce45b6a50 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -421,6 +421,9 @@ au BufNewFile,BufRead *.csp,*.fdr setf csp au BufNewFile,BufRead *.pld setf cupl au BufNewFile,BufRead *.si setf cuplsim +" Dart +au BufRead,BufNewfile *.dart,*.drt setf dart + " Debian Control au BufNewFile,BufRead */debian/control setf debcontrol au BufNewFile,BufRead control @@ -975,6 +978,9 @@ au BufNewFile,BufRead hg-editor-*.txt setf hgcommit " Mercurial config (looks like generic config file) au BufNewFile,BufRead *.hgrc,*hgrc setf cfg +" Meson Build system config +au BufNewFile,BufRead meson.build,meson_options.txt setf meson + " Messages (logs mostly) au BufNewFile,BufRead */log/{auth,cron,daemon,debug,kern,lpr,mail,messages,news/news,syslog,user}{,.log,.err,.info,.warn,.crit,.notice}{,.[0-9]*,-[0-9]*} setf messages diff --git a/src/nvim/search.c b/src/nvim/search.c index 1f382d31c5..fb31e76986 100644 --- a/src/nvim/search.c +++ b/src/nvim/search.c @@ -4184,7 +4184,7 @@ static int is_one_char(char_u *pattern, bool move, pos_T *cur, nmatched = vim_regexec_multi(®match, curwin, curbuf, pos.lnum, regmatch.startpos[0].col, NULL, NULL); - if (!nmatched) { + if (nmatched != 0) { break; } } while (direction == FORWARD @@ -4196,7 +4196,10 @@ static int is_one_char(char_u *pattern, bool move, pos_T *cur, && regmatch.startpos[0].lnum == regmatch.endpos[0].lnum && regmatch.startpos[0].col == regmatch.endpos[0].col); // one char width - if (!result && inc(&pos) >= 0 && pos.col == regmatch.endpos[0].col) { + if (!result + && nmatched != 0 + && inc(&pos) >= 0 + && pos.col == regmatch.endpos[0].col) { result = true; } } diff --git a/src/nvim/tag.c b/src/nvim/tag.c index 1f70a10f28..c8c9677a98 100644 --- a/src/nvim/tag.c +++ b/src/nvim/tag.c @@ -1094,7 +1094,6 @@ find_tags ( int low_char; // first char at low_offset int high_char; // first char at high_offset } search_info; - off_T filesize; int tagcmp; off_T offset; int round; @@ -1503,19 +1502,21 @@ line_read_in: state = TS_LINEAR; } - /* - * When starting a binary search, get the size of the file and - * compute the first offset. - */ + // When starting a binary search, get the size of the file and + // compute the first offset. if (state == TS_BINARY) { if (vim_fseek(fp, 0, SEEK_END) != 0) { + // can't seek, don't use binary search state = TS_LINEAR; } else { - filesize = vim_ftell(fp); + // Get the tag file size. + // Don't use lseek(), it doesn't work + // properly on MacOS Catalina. + const off_T filesize = vim_ftell(fp); vim_fseek(fp, 0, SEEK_SET); - /* Calculate the first read offset in the file. Start - * the search in the middle of the file. */ + // Calculate the first read offset in the file. Start + // the search in the middle of the file. search_info.low_offset = 0; search_info.low_char = 0; search_info.high_offset = filesize; diff --git a/src/nvim/testdir/runtest.vim b/src/nvim/testdir/runtest.vim index 8f5f3f82e7..5c2e570adf 100644 --- a/src/nvim/testdir/runtest.vim +++ b/src/nvim/testdir/runtest.vim @@ -289,11 +289,13 @@ let s:flaky_tests = [ \ 'Test_oneshot()', \ 'Test_out_cb()', \ 'Test_paused()', + \ 'Test_popup_and_window_resize()', \ 'Test_quoteplus()', \ 'Test_quotestar()', \ 'Test_reltime()', \ 'Test_repeat_many()', \ 'Test_repeat_three()', + \ 'Test_state()', \ 'Test_stop_all_in_callback()', \ 'Test_terminal_composing_unicode()', \ 'Test_terminal_redir_file()', diff --git a/src/nvim/testdir/test_alot.vim b/src/nvim/testdir/test_alot.vim index 6bf2e8329c..2c52452f6b 100644 --- a/src/nvim/testdir/test_alot.vim +++ b/src/nvim/testdir/test_alot.vim @@ -27,7 +27,6 @@ source test_jumps.vim source test_fileformat.vim source test_filetype.vim source test_lambda.vim -source test_mapping.vim source test_menu.vim source test_messages.vim source test_modeline.vim diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim index 7512d599b8..4053746c82 100644 --- a/src/nvim/testdir/test_filetype.vim +++ b/src/nvim/testdir/test_filetype.vim @@ -122,6 +122,7 @@ let s:filename_checks = { \ 'cvs': ['cvs123'], \ 'cvsrc': ['.cvsrc'], \ 'cynpp': ['file.cyn'], + \ 'dart': ['file.dart', 'file.drt'], \ 'datascript': ['file.ds'], \ 'dcd': ['file.dcd'], \ 'debcontrol': ['/debian/control'], @@ -201,6 +202,7 @@ let s:filename_checks = { \ 'hex': ['file.hex', 'file.h32'], \ 'hgcommit': ['hg-editor-file.txt'], \ 'hog': ['file.hog', 'snort.conf', 'vision.conf'], + \ 'hollywood': ['file.hws'], \ 'hostconf': ['/etc/host.conf'], \ 'hostsaccess': ['/etc/hosts.allow', '/etc/hosts.deny'], \ 'template': ['file.tmpl'], @@ -273,6 +275,7 @@ let s:filename_checks = { \ 'mason': ['file.mason', 'file.mhtml', 'file.comp'], \ 'master': ['file.mas', 'file.master'], \ 'mel': ['file.mel'], + \ 'meson': ['meson.build', 'meson_options.txt'], \ 'messages': ['/log/auth', '/log/cron', '/log/daemon', '/log/debug', '/log/kern', '/log/lpr', '/log/mail', '/log/messages', '/log/news/news', '/log/syslog', '/log/user', \ '/log/auth.log', '/log/cron.log', '/log/daemon.log', '/log/debug.log', '/log/kern.log', '/log/lpr.log', '/log/mail.log', '/log/messages.log', '/log/news/news.log', '/log/syslog.log', '/log/user.log', \ '/log/auth.err', '/log/cron.err', '/log/daemon.err', '/log/debug.err', '/log/kern.err', '/log/lpr.err', '/log/mail.err', '/log/messages.err', '/log/news/news.err', '/log/syslog.err', '/log/user.err', |