aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/lua/executor.c
Commit message (Collapse)AuthorAge
...
* vim-patch:8.1.0779: argument for message functions is inconsistentJames McCoy2021-11-01
| | | | | | Problem: Argument for message functions is inconsistent. Solution: Make first argument to msg() "char *". https://github.com/vim/vim/commit/32526b3c1846025f0e655f41efd4e5428da16b6c
* vim-patch:8.1.0743: giving error messages is not flexibleJames McCoy2021-11-01
| | | | | | | | | Problem: Giving error messages is not flexible. Solution: Add semsg(). Change argument from "char_u *" to "char *", also for msg() and get rid of most MSG macros. (Ozaki Kiichi, closes vim/vim#3302) Also make emsg() accept a "char *" argument. Get rid of an enormous number of type casts. https://github.com/vim/vim/commit/f9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d
* refactor: split executor.c into two filesDundar Göc2021-10-26
|
* feat: add vim.str_utf_pos functionMichael Lingelbach2021-10-24
| | | | | vim.str_utf_pos returns the codepoints for all utf-8 chars (only, currently) in a string
* fix(runtime): don't use regexes inside lua require'mod'Björn Linse2021-10-17
| | | | | | | | | | | | Fixes #15147 and fixes #15497. Also sketch "subdir" caching. Currently this only caches whether an rtp entry has a "lua/" subdir but we could consider cache other subdirs potentially or even "lua/mybigplugin/" possibly. Note: the async_leftpad test doesn't actually fail on master, at least not deterministically (even when disabling the fast_breakcheck throttling). It's still useful as a regression test for further changes and included as such.
* refactor: format with uncrustify #15842dundargoc2021-10-02
| | | | * refactor: format with uncrustify * refactor: convert function comments to doxygen
* feat(lua): expose lua-cjson as vim.jsonMichael Lingelbach2021-09-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add vim.json.encode and vim.json.decode * use vim.NIL instead of cjson.null * resolve strict-prototypes warnings * The following benchmark shows an approximately 2.5x (750 ms vs 300 ms) improvement in deserialization performance over vim.fn.json_decode on a medium package.json ```lua local uv = vim.loop local function readfile(path) return end local json_url = "https://raw.githubusercontent.com/rust-analyzer/rust-analyzer/b24c8d5c89ee93d1172b4127564f5da3b0c88dad/editors/code/package.json" io.popen(string.format('curl -v -f -L -O %q &> /dev/null', json_url)) local json_string = io.open('package.json'):read '*a' uv.update_time() local start = uv.hrtime() for i = 1,1000 do vim.fn.json_decode(json_string) end uv.update_time() print(string.format("Deserialization time vim.fn.json_decode: %s ms", (uv.hrtime() - start) * (1e-6))) uv.update_time() local start = uv.hrtime() for i = 1,1000 do vim.json.decode(json_string) end uv.update_time() print(string.format("Deserialization time vim.json.decode: %s ms", (uv.hrtime() - start) * (1e-6))) ``` Co-Authored-By: Björn Linse <bjorn.linse@gmail.com>
* refactor: format with uncrustify #15722dundargoc2021-09-19
|
* docs: third-party licenses, TEST_COLORS, system() #15665Justin M. Keyes2021-09-14
|
* feat(lua): make vim.mpack support vim.NIL and vim.empty_dict()Björn Linse2021-09-09
|
* feat(lua): add vim.mpack for msgpack support in luaBjörn Linse2021-09-09
|
* feat(lua)!: register_keystroke_callback => on_keyJustin M. Keyes2021-09-09
| | | | | | | | | Analogous to nodejs's `on('data', …)` interface, here on_key is the "add listener" interface. ref 3ccdbc570d85 #12536 BREAKING_CHANGE: vim.register_keystroke_callback() is now an error.
* fix(lua): make core vim module not dependent on $VIMRUNTIME functionsBjörn Linse2021-08-30
| | | | | | | | | | fixes #15524 Note: this is obviously a quickfix. A scalabe solution will involve being able to specify a _list_ of modules to be put into packages.preload, without needing to manually copypasta a blurb of C code. Perhaps even involving bytecode for static builds (to speedup initialization)
* Merge #15293 Vimscript "method" syntaxJustin M. Keyes2021-08-26
|\ | | | | Port VimL's method call syntax - vim-patch:8.1.{1638,1800,1803,1807,1809,1816,1820,1821,1828,1834,1835,1861,1863,1878,1879,1888,1909,1911,1912}
| * vim-patch:8.1.1800: function call functions have too many argumentsSean Dewar2021-08-12
| | | | | | | | | | | | | | | | | | | | Problem: Function call functions have too many arguments. Solution: Pass values in a funcexe_T struct. https://github.com/vim/vim/commit/c6538bcc1cdd1fb83732f22fdc69bd9bb66f968a Use FUNCEXE_INIT to initialize funcexe_T instances. call_callback() and other Vim listener related stuff is N/A.
* | refactor(map): remove extra-allocating map_new/map_free functionsBjörn Linse2021-08-22
| | | | | | | | | | | | | | | | | | | | Note: the reason for removing them is not that there after this refactor is no use of them, but rather that having them available is an anti-pattern: they manange an _extra_ heap allocation which has nothing to do with the functionality of the map itself (khash manages the real buffers internally). In case there happens to be a reason to allocate the map structure itself later, this should be made explicit using xcalloc/xfree calls.
* | Merge pull request #15451 from bfredl/metamapBjörn Linse2021-08-22
|\ \ | | | | | | perf(map): get rid of unnecessary pointer indirections for maps.
| * | refactor(api): remove unneccesary indirection around handlesBjörn Linse2021-08-22
| |/ | | | | | | | | These things are just maps to pointers, no need to perform a huge song and dance around it.
* / feat(api): add lua C bindings for xdiff (#14536)Lewis Russell2021-08-22
|/ | | | | | | | | | | | | | | | * feat(api): add lua C bindings for xdiff * chore: opt.hunk_lines -> opt.result_type opt.on_hunk now takes precedence over opt.result_type * chore: fix indents Fix indents * chore: change how priv is managed Assign priv NULL and unconditionally apply XFREE_CLEAR to it when finished.
* refactor(lua): initialize lua state at startup instead of dynamicallyBjörn Linse2021-07-19
| | | | | | | | | | lua is used as part of implementation for more core features. As an example, every user keypress will invoke a lua function to check for keypress handlers (regardless if they are registered or not). Thus not starting lua until it is first used doesn't make much sense anymore. nlua_enter was also needed due to the earlier stateful &rtp translation, which by now have been made stateless.
* chore: use codespell to spell check #15016dundargoc2021-07-07
|
* BugFix: Fix inconsistent verbose messageshadmansaleh2021-06-21
| | | | | | | When a keymap is set from lua currently verbose message says it's set from line 1. That's incorrect because we don't really know when it was set. So until proper :verbose support isn't added for sourceing lua it shouldn't say where it was set at.
* refactor(source): Move lua file detection to do_sourceshadmansaleh2021-06-11
| | | | | | So now :source can run lua files too :) * feat: Add support for :[ranged]source for lua files
* lua: use proper conversion of vim.g valuesBjörn Linse2021-05-19
|
* Merge pull request #14318 from chentau/extmark_luadoBjörn Linse2021-04-13
|\ | | | | extmark: splice extmarks on :luado
| * extmark: splice extmarks on :luadochentau2021-04-12
| |
* | test/lsp: disable tracking in LSP tests (here be dragons)Björn Linse2021-04-03
| |
* | luaref: simplify handling of table callables and fix leak in vim.fn.call(table)Björn Linse2021-04-03
| | | | | | | | I AM THE TABLE
* | luaref: fix leaks for global luarefsBjörn Linse2021-04-03
| |
* | lua: track reference ownership with ASAN when presentBjörn Linse2021-04-03
|/
* ts: Add language version to vim.treesitter (#14255)TJ DeVries2021-03-30
|
* lintchentau2021-01-26
|
* Don't show entire context when completingTony Chen2021-01-26
|
* feat: add completion to ':lua'TJ DeVries2021-01-26
|
* api: add vim.version (#13762)Michael Lingelbach2021-01-18
| | | | | | | | | | | | | retrun a structured version dict :lua print(vim.inspect(vim.version())) { api_compatible = 0, api_level = 7, api_prerelease = true, major = 0, minor = 5, patch = 0 }
* executor: use new nlua_ name patternBjörn Linse2020-12-01
|
* startup: add init.lua as an alternative user config, fixes #7895dm1try2020-12-01
|
* Removed restricted mode - Fix #11972georg3tom2020-11-11
|
* lua: make vim.inspect available early so it can be used for path debuggingBjörn Linse2020-11-05
|
* startup: handle autoload and lua packages during startupBjörn Linse2020-11-02
| | | | ¡NO HAY BANDA!
* api: add API for themesBjörn Linse2020-11-01
| | | | | | | | | | co-author: hlpr98 <hlpr98@gmail.com> (dict2hlattrs function) orange is sus?? NOVEMBER DAWN erase the lie that is redraw_later()
* lua: vim.wait allows control of fast events (#13053)TJ DeVries2020-10-06
| | | | | | | | | * lua: vim.wait allows control of fast events * fixup: remove requirement of function for easier waiting * fixup: lint * fixup: bfredl comments
* lua: cleanup naming conventions of executor functionsBjörn Linse2020-09-10
|
* lua: add vim.register_keystroke_callback (#12536)TJ DeVries2020-08-14
| | | | | | | | | | | | | | | * feat: Add vim.register_keystroke_callback * fixup: Forgot to remove mention of old option * fixup: Answer jamessan comments * fixup: Answer norcalli comments * fixup: portability * Update runtime/doc/lua.txt Co-authored-by: Ashkan Kiani <ashkan.k.kiani@gmail.com>
* fix: runtimepath always updates lua package.pathTJ DeVries2020-08-10
|
* Merge pull request #12653 from erw7/fix-build-freebsd-ciJames McCoy2020-07-20
|\ | | | | build: Fix build failure with CI in FreeBSD
| * build: Fix build failure with CI in FreeBSDerw72020-07-20
| | | | | | | | Co-authored-by: James McCoy <jamessan@jamessan.com>
* | lua: Fix crash on unprotected lua errors (#12658)TJ DeVries2020-07-19
|/ | | | | | | | | | | | | | | | | | Can be reproduced with a script like this: -- in some lua file vim.fn.timer_start(10, function() error("uh....") end) -- will cause neovim to crash with the following error. PANIC: unprotected error in call to Lua API (nlua_CFunction_func_call failed.) After this, it will instead print the error message from the top of the stack, like so. tmp/error_nvim.lua:10: uh... Also added an example test. Previously this test caused the embedded nvim to panic.
* lua: Add ability to pass tables with __callTJ DeVries2020-07-10
| | | | | | | | | | | | vim-patch:8.2.1054: not so easy to pass a lua function to Vim vim-patch:8.2.1084: Lua: registering function has useless code I think I have also opened up the possibility for people to use these callbacks elsewhere, since I've added a new struct that we should be able to use. Also, this should allow us to determine what the state of a list is in Lua or a dictionary in Lua, since we now can track the luaref as we go.
* lua: Add ability to pass lua functions directly to vimLTJ DeVries2020-07-10
|