aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/lua/executor.c
Commit message (Collapse)AuthorAge
...
* | feat(lua): add <f-args> to user commands callback (#17522)Javier Lopez2022-02-27
| | | | | | | | | | Works similar to ex <f-args>. It only splits the arguments if the command has more than one posible argument. In cases were the command can only have 1 argument opts.fargs = { opts.args }
* | refactor(lua): use references directly on main threadBjörn Linse2022-02-26
| |
* | feat(lua): add proper support of luv threadserw72022-02-26
|/
* refactor(lua): call loadfile internallyLewis Russell2022-02-18
| | | | | | .. instead of luaL_loadfile allows files to be cached
* vim-patch:8.2.4241: some type casts are redundantDundar Göc2022-01-30
| | | | | | | | Problem: Some type casts are redundant. Solution: Remove the type casts. (closes vim/vim#9643) https://github.com/vim/vim/commit/420fabcd4ffeaf79082a6e43db91e1d363f88f27 This is not a literal port but an equivalent one.
* feat(ts): expose minimum language version to lua (#17186)Thomas Vigouroux2022-01-27
|
* fix(lua): print multiple return values with =expr (#16933)Shadman2022-01-06
|
* feat: filetype.lua (#16600)Gregory Anders2022-01-04
| | | | Adds a new vim.filetype module that provides support for filetype detection in Lua.
* feat(lua): make =expr print result of exprshadmansaleh2022-01-04
|
* feat(api): implement nvim_{add,del}_user_commandGregory Anders2021-12-28
| | | | | Add support for adding and removing custom user commands with the Nvim API.
* perf: pre-compile embedded Lua source into bytecode (#16631)Gregory Anders2021-12-16
| | | | | | The Lua modules that make up vim.lua are embedded as raw source files into the nvim binary. These sources are loaded by the Lua runtime on startuptime. We can pre-compile these sources into Lua bytecode before embedding them into the binary, which minimizes the size of the binary and improves startuptime.
* refactor(misc1): move out high-level input functions to a new file: input.cBjörn Linse2021-12-10
| | | | | Possibly dialog code is messages.c could be moved here as well. misc1.c is now empty, so delete it.
* fix: check for interrupt in nvim_echo, write_msg and nlua_print (#16537)ii142021-12-08
| | | | | Fixes `q` in more pager, where `:highlight` can be quit out of with a single `q` keystroke, while in `:lua print(vim.inspect(vim))` it just scrolls down a page.
* refactor: reduce number of explicit char casts (#16077)dundargoc2021-11-16
| | | * refactor: reduce number of explicit char casts
* feat(lua): enable stack traces in error output (#16228)Gregory Anders2021-11-06
|
* 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 }