diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-11-28 22:43:10 +0100 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2023-02-22 22:15:19 +0100 |
commit | 799edca18a4ddcf8edcb63dd391219e01e187f0d (patch) | |
tree | ee038fd6f6dfd129998f711be31ab19a2c8f8b6a /runtime/doc | |
parent | 09b6a68c3700aa5d8ae26a62896b091572ae0a8d (diff) | |
download | rneovim-799edca18a4ddcf8edcb63dd391219e01e187f0d.tar.gz rneovim-799edca18a4ddcf8edcb63dd391219e01e187f0d.tar.bz2 rneovim-799edca18a4ddcf8edcb63dd391219e01e187f0d.zip |
feat(lua): make sure require'bit' always works, even with PUC lua 5.1
Diffstat (limited to 'runtime/doc')
-rw-r--r-- | runtime/doc/lua.txt | 16 | ||||
-rw-r--r-- | runtime/doc/news.txt | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 32e89bd237..8ae1c6dc40 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -33,6 +33,22 @@ Lua 5.1, not worry about forward-compatibility with future Lua versions. If Nvim ever ships with Lua 5.4+, a Lua 5.1 compatibility shim will be provided so that old plugins continue to work transparently. + *lua-luajit* +Neovim is built with luajit on platforms which support it, which provides +extra functionality. Lua code in |init.lua| and plugins can assume its presence +on installations on common platforms. For maximum compatibility with less +common platforms, availability can be checked using the `jit` global variable: >lua + if jit then + -- code for luajit + else + -- code for plain lua 5.1 + end +< + *lua-bit* +In particular, the luajit "bit" extension module is _always_ available. +A fallback implementation is included when nvim is built with PUC lua 5.1, +and will be transparently used when `require("bit")` is invoked. + ============================================================================== LUA CONCEPTS AND IDIOMS *lua-concepts* diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 6f505a958a..4dee958108 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -167,6 +167,7 @@ The following new APIs or features were added. • |vim.treesitter.language.add()| as a new replacement for `vim.treesitter.language.require_language`. +• `require'bit'` is now always available |lua-bit| ============================================================================== CHANGED FEATURES *news-changes* |