diff options
-rw-r--r-- | contrib/flake.nix | 4 | ||||
-rw-r--r-- | runtime/doc/syntax.txt | 3 | ||||
-rw-r--r-- | runtime/doc/usr_05.txt | 8 | ||||
-rw-r--r-- | runtime/doc/usr_06.txt | 24 | ||||
-rw-r--r-- | runtime/filetype.vim | 3 | ||||
-rw-r--r-- | runtime/indent/testdir/yaml.in | 6 | ||||
-rw-r--r-- | runtime/indent/testdir/yaml.ok | 6 | ||||
-rw-r--r-- | runtime/lua/vim/filetype.lua | 2 | ||||
-rw-r--r-- | runtime/lua/vim/shared.lua | 5 | ||||
-rwxr-xr-x | scripts/gen_vimdoc.py | 9 | ||||
-rwxr-xr-x | src/nvim/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/nvim/api/vim.c | 30 | ||||
-rw-r--r-- | src/nvim/autocmd.c | 7 | ||||
-rw-r--r-- | src/nvim/ex_cmds.c | 82 | ||||
-rw-r--r-- | src/nvim/ex_docmd.c | 2 | ||||
-rw-r--r-- | src/nvim/os/lang.c | 60 | ||||
-rw-r--r-- | src/nvim/testdir/test_filetype.vim | 1 | ||||
-rw-r--r-- | src/nvim/testdir/test_help_tagjump.vim | 14 | ||||
-rw-r--r-- | test/functional/lua/vim_spec.lua | 4 |
19 files changed, 150 insertions, 124 deletions
diff --git a/contrib/flake.nix b/contrib/flake.nix index 848c52d208..a1072674ba 100644 --- a/contrib/flake.nix +++ b/contrib/flake.nix @@ -16,6 +16,10 @@ neovim = pkgs.neovim-unwrapped.overrideAttrs (oa: { version = "master"; src = ../.; + + buildInputs = oa.buildInputs ++ pkgs.lib.optionals pkgs.stdenv.isDarwin (with pkgs.darwin.apple_sdk.frameworks; [ + CoreServices + ]); }); # a development binary to help debug issues diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index b97f158c31..2a78d975ee 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -26,7 +26,8 @@ In the User Manual: 1. Quick start *:syn-qstart* *:syn-enable* *:syntax-enable* *:syn-on* *:syntax-on* -This command switches on syntax highlighting: > +Syntax highlighting is enabled by default. If you need to enable it again +after it was disabled (see below), use: > :syntax enable diff --git a/runtime/doc/usr_05.txt b/runtime/doc/usr_05.txt index b1ef563e43..1cf383dce3 100644 --- a/runtime/doc/usr_05.txt +++ b/runtime/doc/usr_05.txt @@ -139,13 +139,11 @@ quite complicated things. Still, it is just a sequence of commands that are executed like you typed them. > - syntax on set hlsearch -This switches on syntax highlighting. And the 'hlsearch' option tells Vim to -highlight matches with the last used search pattern. The "if" command is very -useful to set options only when some condition is met. More about that in -|usr_41.txt|. +This option tells Vim to highlight matches with the last used search pattern. +The "if" command is very useful to set options only when some condition is +met. More about that in |usr_41.txt|. *vimrc-filetype* > filetype plugin indent on diff --git a/runtime/doc/usr_06.txt b/runtime/doc/usr_06.txt index 360f72ec63..b99e0fb482 100644 --- a/runtime/doc/usr_06.txt +++ b/runtime/doc/usr_06.txt @@ -24,28 +24,8 @@ Table of contents: |usr_toc.txt| ============================================================================== *06.1* Switching it on -It all starts with one simple command: > - - :syntax enable - -That should work in most situations to get color in your files. Vim will -automagically detect the type of file and load the right syntax highlighting. -Suddenly comments are blue, keywords brown and strings red. This makes it -easy to overview the file. After a while you will find that black&white text -slows you down! - -If you always want to use syntax highlighting, put the ":syntax enable" -command in your |init.vim| file. - -If you want syntax highlighting only when the terminal supports colors, you -can put this in your |init.vim| file: > - - if &t_Co > 1 - syntax enable - endif - -If you want syntax highlighting only in the GUI version, put the ":syntax -enable" command in your |ginit.vim| file. +Syntax highlighting is enabled by default. Nvim will automagically detect the +type of file and load the right syntax highlighting. ============================================================================== *06.2* No or wrong colors? diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 7337647b03..8d0efb21d9 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1588,6 +1588,9 @@ au BufNewFile,BufRead *.rng setf rng " RPL/2 au BufNewFile,BufRead *.rpl setf rpl +" Robot Framework +au BufNewFile,BufRead *.robot,*.resource setf robot + " Robots.txt au BufNewFile,BufRead robots.txt setf robots diff --git a/runtime/indent/testdir/yaml.in b/runtime/indent/testdir/yaml.in index 8515e1752c..32ddc60956 100644 --- a/runtime/indent/testdir/yaml.in +++ b/runtime/indent/testdir/yaml.in @@ -17,3 +17,9 @@ map: val map: multiline value # END_INDENT + +# START_INDENT +map: | +line1 +line2 +# END_INDENT diff --git a/runtime/indent/testdir/yaml.ok b/runtime/indent/testdir/yaml.ok index 5ca2871fc9..becdb1bae1 100644 --- a/runtime/indent/testdir/yaml.ok +++ b/runtime/indent/testdir/yaml.ok @@ -17,3 +17,9 @@ map: val map: multiline value # END_INDENT + +# START_INDENT +map: | + line1 + line2 +# END_INDENT diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 2a34fec7f2..f401de38f4 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -561,6 +561,8 @@ local extension = { snw = "rnoweb", Rnw = "rnoweb", Snw = "rnoweb", + robot = "robot", + resource = "robot", rsc = "routeros", x = "rpcgen", rpl = "rpl", diff --git a/runtime/lua/vim/shared.lua b/runtime/lua/vim/shared.lua index f0dc34608c..172fac3a88 100644 --- a/runtime/lua/vim/shared.lua +++ b/runtime/lua/vim/shared.lua @@ -365,7 +365,10 @@ function vim.tbl_get(o, ...) if #keys == 0 then return end - for _, k in ipairs(keys) do + for i, k in ipairs(keys) do + if type(o[k]) ~= 'table' and next(keys, i) then + return nil + end o = o[k] if o == nil then return diff --git a/scripts/gen_vimdoc.py b/scripts/gen_vimdoc.py index f37198e96a..57b46a381e 100755 --- a/scripts/gen_vimdoc.py +++ b/scripts/gen_vimdoc.py @@ -53,11 +53,20 @@ import logging from xml.dom import minidom MIN_PYTHON_VERSION = (3, 6) +MIN_DOXYGEN_VERSION = (1, 9, 0) if sys.version_info < MIN_PYTHON_VERSION: print("requires Python {}.{}+".format(*MIN_PYTHON_VERSION)) sys.exit(1) +doxygen_version = tuple([int(i) for i in subprocess.check_output(["doxygen", "-v"], + universal_newlines=True).split()[0].split('.')]) + +if doxygen_version < MIN_DOXYGEN_VERSION: + print("\nRequires doxygen {}.{}.{}+".format(*MIN_DOXYGEN_VERSION)) + print("Your doxygen version is {}.{}.{}\n".format(*doxygen_version)) + sys.exit(1) + # DEBUG = ('DEBUG' in os.environ) INCLUDE_C_DECL = ('INCLUDE_C_DECL' in os.environ) INCLUDE_DEPRECATED = ('INCLUDE_DEPRECATED' in os.environ) diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index 64de2ec7e0..2cf1bda45f 100755 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -16,8 +16,8 @@ if(WIN32) # tell MinGW compiler to enable wmain set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -municode") elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework CoreFoundation") - set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -framework CoreFoundation") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework CoreServices") + set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -framework CoreServices") endif() set(TOUCHES_DIR ${PROJECT_BINARY_DIR}/touches) diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 3d1b5eade4..061653c5af 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -2624,27 +2624,27 @@ Dictionary nvim_parse_cmd(String str, Dictionary opts, Error *err) PUT(mods, "emsg_silent", BOOLEAN_OBJ(cmdinfo.emsg_silent)); PUT(mods, "sandbox", BOOLEAN_OBJ(cmdinfo.sandbox)); PUT(mods, "noautocmd", BOOLEAN_OBJ(cmdinfo.noautocmd)); - PUT(mods, "tab", INTEGER_OBJ(cmdmod.tab)); + PUT(mods, "tab", INTEGER_OBJ(cmdinfo.cmdmod.tab)); PUT(mods, "verbose", INTEGER_OBJ(cmdinfo.verbose)); - PUT(mods, "browse", BOOLEAN_OBJ(cmdmod.browse)); - PUT(mods, "confirm", BOOLEAN_OBJ(cmdmod.confirm)); - PUT(mods, "hide", BOOLEAN_OBJ(cmdmod.hide)); - PUT(mods, "keepalt", BOOLEAN_OBJ(cmdmod.keepalt)); - PUT(mods, "keepjumps", BOOLEAN_OBJ(cmdmod.keepjumps)); - PUT(mods, "keepmarks", BOOLEAN_OBJ(cmdmod.keepmarks)); - PUT(mods, "keeppatterns", BOOLEAN_OBJ(cmdmod.keeppatterns)); - PUT(mods, "lockmarks", BOOLEAN_OBJ(cmdmod.lockmarks)); - PUT(mods, "noswapfile", BOOLEAN_OBJ(cmdmod.noswapfile)); - PUT(mods, "vertical", BOOLEAN_OBJ(cmdmod.split & WSP_VERT)); + PUT(mods, "browse", BOOLEAN_OBJ(cmdinfo.cmdmod.browse)); + PUT(mods, "confirm", BOOLEAN_OBJ(cmdinfo.cmdmod.confirm)); + PUT(mods, "hide", BOOLEAN_OBJ(cmdinfo.cmdmod.hide)); + PUT(mods, "keepalt", BOOLEAN_OBJ(cmdinfo.cmdmod.keepalt)); + PUT(mods, "keepjumps", BOOLEAN_OBJ(cmdinfo.cmdmod.keepjumps)); + PUT(mods, "keepmarks", BOOLEAN_OBJ(cmdinfo.cmdmod.keepmarks)); + PUT(mods, "keeppatterns", BOOLEAN_OBJ(cmdinfo.cmdmod.keeppatterns)); + PUT(mods, "lockmarks", BOOLEAN_OBJ(cmdinfo.cmdmod.lockmarks)); + PUT(mods, "noswapfile", BOOLEAN_OBJ(cmdinfo.cmdmod.noswapfile)); + PUT(mods, "vertical", BOOLEAN_OBJ(cmdinfo.cmdmod.split & WSP_VERT)); const char *split; - if (cmdmod.split & WSP_BOT) { + if (cmdinfo.cmdmod.split & WSP_BOT) { split = "botright"; - } else if (cmdmod.split & WSP_TOP) { + } else if (cmdinfo.cmdmod.split & WSP_TOP) { split = "topleft"; - } else if (cmdmod.split & WSP_BELOW) { + } else if (cmdinfo.cmdmod.split & WSP_BELOW) { split = "belowright"; - } else if (cmdmod.split & WSP_ABOVE) { + } else if (cmdinfo.cmdmod.split & WSP_ABOVE) { split = "aboveleft"; } else { split = ""; diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c index bfeb70dce9..9bc0a4fabf 100644 --- a/src/nvim/autocmd.c +++ b/src/nvim/autocmd.c @@ -1191,8 +1191,9 @@ char_u *aucmd_next_pattern(char_u *pat, size_t patlen) /// Return OK for success, FAIL for failure; /// /// @param do_msg give message for no matching autocmds? -int do_doautocmd(char_u *arg, bool do_msg, bool *did_something) +int do_doautocmd(char_u *arg_start, bool do_msg, bool *did_something) { + char_u *arg = arg_start; int nothing_done = true; if (did_something != NULL) { @@ -1224,8 +1225,8 @@ int do_doautocmd(char_u *arg, bool do_msg, bool *did_something) } } - if (nothing_done && do_msg) { - msg(_("No matching autocommands")); + if (nothing_done && do_msg && !aborting()) { + smsg(_("No matching autocommands: %s"), arg_start); } if (did_something != NULL) { *did_something = !nothing_done; diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 5cd3e7f968..06fa981ba7 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -5023,37 +5023,59 @@ static int help_compare(const void *s1, const void *s2) int find_help_tags(const char *arg, int *num_matches, char ***matches, bool keep_lang) { int i; - static const char *(mtable[]) = { - "*", "g*", "[*", "]*", - "/*", "/\\*", "\"*", "**", - "/\\(\\)", "/\\%(\\)", - "?", ":?", "?<CR>", "g?", "g?g?", "g??", - "-?", "q?", "v_g?", - "/\\?", "/\\z(\\)", "\\=", ":s\\=", - "[count]", "[quotex]", - "[range]", ":[range]", - "[pattern]", "\\|", "\\%$", - "s/\\~", "s/\\U", "s/\\L", - "s/\\1", "s/\\2", "s/\\3", "s/\\9" - }; - static const char *(rtable[]) = { - "star", "gstar", "[star", "]star", - "/star", "/\\\\star", "quotestar", "starstar", - "/\\\\(\\\\)", "/\\\\%(\\\\)", - "?", ":?", "?<CR>", "g?", "g?g?", "g??", - "-?", "q?", "v_g?", - "/\\\\?", "/\\\\z(\\\\)", "\\\\=", ":s\\\\=", - "\\[count]", "\\[quotex]", - "\\[range]", ":\\[range]", - "\\[pattern]", "\\\\bar", "/\\\\%\\$", - "s/\\\\\\~", "s/\\\\U", "s/\\\\L", - "s/\\\\1", "s/\\\\2", "s/\\\\3", "s/\\\\9" + + // Specific tags that either have a specific replacement or won't go + // throught the generic rules. + static char *(except_tbl[][2]) = { + { "*", "star" }, + { "g*", "gstar" }, + { "[*", "[star" }, + { "]*", "]star" }, + { ":*", ":star" }, + { "/*", "/star" }, // NOLINT + { "/\\*", "/\\\\star" }, + { "\"*", "quotestar" }, + { "**", "starstar" }, + { "cpo-*", "cpo-star" }, + { "/\\(\\)", "/\\\\(\\\\)" }, + { "/\\%(\\)", "/\\\\%(\\\\)" }, + { "?", "?" }, + { "??", "??" }, + { ":?", ":?" }, + { "?<CR>", "?<CR>" }, + { "g?", "g?" }, + { "g?g?", "g?g?" }, + { "g??", "g??" }, + { "-?", "-?" }, + { "q?", "q?" }, + { "v_g?", "v_g?" }, + { "/\\?", "/\\\\?" }, + { "/\\z(\\)", "/\\\\z(\\\\)" }, + { "\\=", "\\\\=" }, + { ":s\\=", ":s\\\\=" }, + { "[count]", "\\[count]" }, + { "[quotex]", "\\[quotex]" }, + { "[range]", "\\[range]" }, + { ":[range]", ":\\[range]" }, + { "[pattern]", "\\[pattern]" }, + { "\\|", "\\\\bar" }, + { "\\%$", "/\\\\%\\$" }, + { "s/\\~", "s/\\\\\\~" }, + { "s/\\U", "s/\\\\U" }, + { "s/\\L", "s/\\\\L" }, + { "s/\\1", "s/\\\\1" }, + { "s/\\2", "s/\\\\2" }, + { "s/\\3", "s/\\\\3" }, + { "s/\\9", "s/\\\\9" }, + { NULL, NULL } }; + static const char *(expr_table[]) = { "!=?", "!~?", "<=?", "<?", "==?", "=~?", ">=?", ">?", "is?", "isnot?" }; char *d = (char *)IObuff; // assume IObuff is long enough! + d[0] = NUL; if (STRNICMP(arg, "expr-", 5) == 0) { // When the string starting with "expr-" and containing '?' and matches @@ -5075,16 +5097,16 @@ int find_help_tags(const char *arg, int *num_matches, char ***matches, bool keep } } else { // Recognize a few exceptions to the rule. Some strings that contain - // '*' with "star". Otherwise '*' is recognized as a wildcard. - for (i = (int)ARRAY_SIZE(mtable); --i >= 0;) { - if (STRCMP(arg, mtable[i]) == 0) { - STRCPY(d, rtable[i]); + // '*'are changed to "star", otherwise '*' is recognized as a wildcard. + for (i = 0; except_tbl[i][0] != NULL; i++) { + if (STRCMP(arg, except_tbl[i][0]) == 0) { + STRCPY(d, except_tbl[i][1]); break; } } } - if (i < 0) { // no match in table + if (d[0] == NUL) { // no match in table // Replace "\S" with "/\\S", etc. Otherwise every tag is matched. // Also replace "\%^" and "\%(", they match every tag too. // Also "\zs", "\z1", etc. diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 7b5d14a404..b2a71b386b 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -1306,6 +1306,7 @@ bool parse_cmdline(char_u *cmdline, exarg_T *eap, CmdParseInfo *cmdinfo) char *errormsg = NULL; char *cmd; char *p; + cmdmod_T save_cmdmod = cmdmod; // Initialize cmdinfo memset(cmdinfo, 0, sizeof(*cmdinfo)); @@ -1346,6 +1347,7 @@ bool parse_cmdline(char_u *cmdline, exarg_T *eap, CmdParseInfo *cmdinfo) p_verbose = eap->verbose_save; } cmdinfo->cmdmod = cmdmod; + cmdmod = save_cmdmod; // Save location after command modifiers cmd = eap->cmd; diff --git a/src/nvim/os/lang.c b/src/nvim/os/lang.c index b63faacaae..28f43ff3af 100644 --- a/src/nvim/os/lang.c +++ b/src/nvim/os/lang.c @@ -3,9 +3,10 @@ #ifdef __APPLE__ # define Boolean CFBoolean // Avoid conflict with API's Boolean -# include <CoreFoundation/CFLocale.h> -# include <CoreFoundation/CFString.h> +# define FileInfo CSFileInfo // Avoid conflict with API's Fileinfo +# include <CoreServices/CoreServices.h> # undef Boolean +# undef FileInfo #endif #include "auto/config.h" @@ -21,55 +22,24 @@ void lang_init(void) { #ifdef __APPLE__ if (os_getenv("LANG") == NULL) { - const char *lang_region = NULL; - CFTypeRef cf_lang_region = NULL; - - CFLocaleRef cf_locale = CFLocaleCopyCurrent(); - if (cf_locale) { - cf_lang_region = CFLocaleGetValue(cf_locale, kCFLocaleIdentifier); - CFRetain(cf_lang_region); - lang_region = CFStringGetCStringPtr(cf_lang_region, - kCFStringEncodingUTF8); - CFRelease(cf_locale); - } else { - // Use the primary language defined in Preferences -> Language & Region - CFArrayRef cf_langs = CFLocaleCopyPreferredLanguages(); - if (cf_langs && CFArrayGetCount(cf_langs) > 0) { - cf_lang_region = CFArrayGetValueAtIndex(cf_langs, 0); - CFRetain(cf_lang_region); - CFRelease(cf_langs); - lang_region = CFStringGetCStringPtr(cf_lang_region, - kCFStringEncodingUTF8); - } else { - ELOG("$LANG is empty and your primary language cannot be inferred."); - return; - } - } - char buf[50] = { 0 }; - bool set_lang; - if (lang_region) { - set_lang = true; - xstrlcpy(buf, lang_region, sizeof(buf)); - } else { - set_lang = CFStringGetCString(cf_lang_region, buf, 40, - kCFStringEncodingUTF8); - } - if (set_lang) { + + // $LANG is not set, either because it was unset or Nvim was started + // from the Dock. Query the system locale. + if (LocaleRefGetPartString(NULL, + kLocaleLanguageMask | kLocaleLanguageVariantMask | + kLocaleRegionMask | kLocaleRegionVariantMask, + sizeof(buf) - 10, buf) == noErr && *buf) { if (strcasestr(buf, "utf-8") == NULL) { xstrlcat(buf, ".UTF-8", sizeof(buf)); } os_setenv("LANG", buf, true); + setlocale(LC_ALL, ""); + // Make sure strtod() uses a decimal point, not a comma. + setlocale(LC_NUMERIC, "C"); + } else { + ELOG("$LANG is empty and the macOS primary language cannot be inferred."); } - CFRelease(cf_lang_region); -# ifdef HAVE_LOCALE_H - setlocale(LC_ALL, ""); - -# ifdef LC_NUMERIC - // Make sure strtod() uses a decimal point, not a comma. - setlocale(LC_NUMERIC, "C"); -# endif -# endif } #endif } diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim index 6ae957da70..63b598dca8 100644 --- a/src/nvim/testdir/test_filetype.vim +++ b/src/nvim/testdir/test_filetype.vim @@ -456,6 +456,7 @@ let s:filename_checks = { \ 'rib': ['file.rib'], \ 'rnc': ['file.rnc'], \ 'rng': ['file.rng'], + \ 'robot': ['file.robot', 'file.resource'], \ 'robots': ['robots.txt'], \ 'routeros': ['file.rsc'], \ 'rpcgen': ['file.x'], diff --git a/src/nvim/testdir/test_help_tagjump.vim b/src/nvim/testdir/test_help_tagjump.vim index a43889b57e..ece8ccf215 100644 --- a/src/nvim/testdir/test_help_tagjump.vim +++ b/src/nvim/testdir/test_help_tagjump.vim @@ -28,11 +28,25 @@ func Test_help_tagjump() call assert_true(getline('.') =~ '\*quote\*') helpclose + help * + call assert_equal("help", &filetype) + call assert_true(getline('.') =~ '\*star\*') + helpclose + help "* call assert_equal("help", &filetype) call assert_true(getline('.') =~ '\*quotestar\*') helpclose + " The test result is different in vim. There ":help ??" will jump to the + " falsy operator ??, which hasn't been ported to neovim yet. Instead, neovim + " jumps to the tag "g??". This test result needs to be changed if neovim + " ports the falsy operator. + help ?? + call assert_equal("help", &filetype) + call assert_true(getline('.') =~ '\*g??\*') + helpclose + help ch?ckhealth call assert_equal("help", &filetype) call assert_true(getline('.') =~ '\*:checkhealth\*') diff --git a/test/functional/lua/vim_spec.lua b/test/functional/lua/vim_spec.lua index d9a8dfd2e8..73e4d7ca79 100644 --- a/test/functional/lua/vim_spec.lua +++ b/test/functional/lua/vim_spec.lua @@ -492,6 +492,10 @@ describe('lua stdlib', function() it('vim.tbl_get', function() eq(true, exec_lua("return vim.tbl_get({ test = { nested_test = true }}, 'test', 'nested_test')")) + eq(NIL, exec_lua("return vim.tbl_get({ unindexable = true }, 'unindexable', 'missing_key')")) + eq(NIL, exec_lua("return vim.tbl_get({ unindexable = 1 }, 'unindexable', 'missing_key')")) + eq(NIL, exec_lua("return vim.tbl_get({ unindexable = coroutine.create(function () end) }, 'unindexable', 'missing_key')")) + eq(NIL, exec_lua("return vim.tbl_get({ unindexable = function () end }, 'unindexable', 'missing_key')")) eq(NIL, exec_lua("return vim.tbl_get({}, 'missing_key')")) eq(NIL, exec_lua("return vim.tbl_get({})")) end) |