aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/lua/executor.c
Commit message (Collapse)AuthorAge
* fix(test): fix issues detected by running unittests in ASAN/UBSANbfredl2023-01-31
|
* feat(lua): low-level interpreter mode (nvim -ll)bfredl2023-01-31
|
* refactor: replace char_u with char 25 (#21838)dundargoc2023-01-19
| | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u with char 24 (#21823)dundargoc2023-01-18
| | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
* refactor: fix IWYU mapping file and use IWYU (#21802)dundargoc2023-01-15
| | | Also add the EXITFREE definition to main_lib rather than the nvim target, as the header generation needs the EXITFREE flag to work properly.
* refactor: replace char_u with char 18 (#21237)dundargoc2023-01-09
| | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
* feat(lua): store "nvim -l" scriptname in _G.arg[0]Justin M. Keyes2023-01-07
|
* fix(coverity/433537): don't call kv_concat_len() when read_size is 0 (#21664)zeertzjq2023-01-07
| | | fix(coverity): don't call kv_concat_len() when read_size is 0
* refactor: extract code to open stdin for readingJustin M. Keyes2023-01-05
|
* refactor(lua): move _G.arg init to nlua_init()Justin M. Keyes2023-01-05
|
* feat(lua): execute stdin ("-") as LuaJustin M. Keyes2023-01-05
|
* feat(lua): exit 1 on Lua "-l" script errorJustin M. Keyes2023-01-05
|
* feat(lua): send "--" literally to Lua "-l" scriptJustin M. Keyes2023-01-05
| | | | | | | | | | | | Problem: When "-l" is followed by "--", we stop sending args to the Lua script and treat "--" in the usual way. This was for flexibility but didn't have a strong use-case, and has these problems: - prevents Lua "-l" scripts from handling "--" in their own way. - complicates the startup logic (must call nlua_init before command_line_scan) Solution: Don't treat "--" specially if it follows "-l".
* feat(lua)!: execute Lua with "nvim -l"Justin M. Keyes2023-01-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Nvim has Lua but the "nvim" CLI can't easily be used to execute Lua scripts, especially scripts that take arguments or produce output. Solution: - support "nvim -l [args...]" for running scripts. closes #15749 - exit without +q - remove lua2dox_filter - remove Doxyfile. This wasn't used anyway, because the doxygen config is inlined in gen_vimdoc.py (`Doxyfile` variable). - use "nvim -l" in docs-gen CI job Examples: $ nvim -l scripts/lua2dox.lua --help Lua2DoX (0.2 20130128) ... $ echo "print(vim.inspect(_G.arg))" | nvim -l - --arg1 --arg2 $ echo 'print(vim.inspect(vim.api.nvim_buf_get_text(1,0,0,-1,-1,{})))' | nvim +"put ='text'" -l - TODO? -e executes Lua code -l loads a module -i enters REPL _after running the other arguments_.
* refactor(ui): devirtualize the ui layerbfredl2023-01-05
| | | | | | | | | | | | | | | | | - The defined interface for the UI is only the RPC protocol. The original UI interface as an array of function pointers fill no function. - On the server, all the UI:s are all RPC channels. - ui.c is only used on the server. - The compositor is a preprocessing step for single-grid UI:s - on the client, ui_client and tui talk directly to each other - we still do module separation, as ui_client.c could form the basis of a libnvim client module later. Items for later PR:s - vim.ui_attach is still an unhappy child, reconsider based on plugin experience. - the flags in ui_events.in.h are still a mess. Can be simplified now. - UX for remote attachment needs more work. - startup for client can be simplified further (think of the millisecs we can save)
* refactor(api): do not allocate temporaries for internal eventsbfredl2023-01-03
|
* refactor: rename mch_msg => os_msgJustin M. Keyes2022-12-16
|
* fix(secure): crash when hitting escape in prompt (#21283)ii142022-12-05
| | | | | | | | - use pcall when calling vim.secure.read from C - catch keyboard interrupts in vim.secure.read, rethrow other errors - selecting "view" in prompt runs :view command - simplify lua stack cleanup with lua_gettop and lua_settop Co-authored-by: ii14 <ii14@users.noreply.github.com>
* refactor: make sure getting a callback doesn't modify argumentzeertzjq2022-12-03
|
* feat(secure): add `:trust` command and vim.secure.trust() (#21107)Jlll12022-11-28
| | | | | | | | | Introduce vim.secure.trust() to programmatically manage the trust database. Use this function in a new :trust ex command which can be used as a simple frontend. Resolves: https://github.com/neovim/neovim/issues/21092 Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: ii14 <ii14@users.noreply.github.com>
* feat(exrc): use vim.secure.read() for 'exrc' optionGregory Anders2022-11-17
|
* Merge pull request #20157 from dundargoc/build/iwyubfredl2022-11-15
|\ | | | | build: allow IWYU to fix includes for all .c files
| * build: allow IWYU to fix includes for all .c filesdundargoc2022-11-15
| | | | | | | | | | | | | | | | | | | | Allow Include What You Use to remove unnecessary includes and only include what is necessary. This helps with reducing compilation times and makes it easier to visualise which dependencies are actually required. Work on https://github.com/neovim/neovim/issues/549, but doesn't close it since this only works fully for .c files and not headers.
* | ci(windows): treat compiler warnings as errorsdundargoc2022-11-14
|/ | | | Reduce the warning level from 3 to 1 and fix all warnings.
* feat(api): add command name to Lua command callback optsFamiu Haque2022-11-07
| | | | | | | | | | | | | | | | Adds a `name` key to the opts dict passed to Lua command callbacks created using `nvim_create_user_command()`. This is useful for when multiple commands use the same callback. Note that this kind of behavior is not as strange as one might think, even some internal Neovim commands reuse the same internal C function, differing their behavior by checking the command name. `substitute`, `smagic` and `snomagic` are examples of that. This will also be useful for generalized Lua command preview functions that can preview a wide range of commands, in which case knowing the command name is necessary for the preview function to actually be able to execute the command that it's supposed to preview.
* build(lint): remove clint.py rules for braces #20880dundargoc2022-11-01
| | | | | Uncrustify is the source of truth where possible. Remove any redundant checks from clint.py. See also https://github.com/neovim/neovim/pull/18563
* refactor: replace char_u with charDundar Göc2022-10-15
| | | | Work on https://github.com/neovim/neovim/issues/459
* fix(lua): fix architecture-dependent behavior in usercmd "reg" (#20384)zeertzjq2022-09-28
| | | | | | | | I don't think using an integer as a NUL-terminated string can work on big-endian systems, at least. This is also not tested. Add a test. Also fix a mistake in the docs of nvim_parse_cmd.
* fix(redraw): avoid unnecessary redraws and glitches with floats+messagesbfredl2022-09-22
| | | | | fixes #20106 fixes #20229
* vim-patch:8.1.0941: macros for MS-Windows are inconsistent (#20215)dundargoc2022-09-18
| | | | | | | Problem: Macros for MS-Windows are inconsistent, using "32", "3264 and others. Solution: Use MSWIN for all MS-Windows builds. Use FEAT_GUI_MSWIN for the GUI build. (Hirohito Higashi, closes vim/vim#3932) https://github.com/vim/vim/commit/4f97475d326c2773a78561fb874e4f23c25cbcd9
* vim-patch:8.2.3796: the funcexe_T struct members are not named consistently ↵zeertzjq2022-09-16
| | | | | | | | | (#20214) Problem: The funcexe_T struct members are not named consistently. Solution: Prefix "fe_" to all the members. https://github.com/vim/vim/commit/851f86b951cdd67ad9cf3149e46169d1375c8d82 Omit fe_check_type: always NULL in legacy Vim script.
* vim-patch:8.2.0067: ERROR_UNKNOWN clashes on some systems (#20212)zeertzjq2022-09-16
| | | | | | | Problem: ERROR_UNKNOWN clashes on some systems. Solution: Rename ERROR_ to FCERR_. (Ola Söder, closes vim/vim#5415) https://github.com/vim/vim/commit/ef140544f6703a7a4c0f6a15f610508ed6b09e89 Remove ERROR_BOTH which was removed from Vim in patch 7.4.1582.
* refactor: replace char_u with charDundar Göc2022-09-11
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u with charDundar Göc2022-09-09
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor(typval): change FC_CFUNC abstraction into FC_LUAREFbfredl2022-09-07
| | | | | | | | | | | | "cfuncs" was only ever used to wrap luarefs. As vim8script is finished and will not be developed further, support for "cfuncs" for other usecases are not planned. This abstraction was immediately broken anyway in order to get luarefs out of userfuncs again. Even if a new kind of userfunc needs to be invented in the future, likely just extending the FC_... flag union directy, instead of invoking unnecessary heap object and c function pointer indirection, will be a more straightforward design pattern.
* fix(api)!: correctly deal with number before :tabzeertzjq2022-09-02
| | | | | | Now nvim_parse_cmd and nvim_create_user_command use a "tab" value which is the same as the number passed before :tab modifier instead of the number plus 1, and "tab" value is -1 if :tab modifier is not used.
* feat(api): add support for :horizontal modifierzeertzjq2022-09-01
|
* feat(lua): vim.ui_attach to get ui events from luabfredl2022-08-31
| | | | Co-authored-by: Famiu Haque <famiuhaque@protonmail.com>
* fix(exceptions): restore `did_throw` (#20000)Sean Dewar2022-08-30
| | | | | | | | | | | | | | | | | | `!did_throw` doesn't exactly imply `!current_exception`, as `did_throw = false` is sometimes used to defer exception handling for later (without forgetting the exception). E.g: uncaught exception handling in `do_cmdline()` may be deferred to a different call (e.g: when `try_level > 0`). In #7881, `current_exception = NULL` in `do_cmdline()` is used as an analogue of `did_throw = false`, but also causes the pending exception to be lost, which also leaks as `discard_exception()` wasn't used. It may be possible to fix this by saving/restoring `current_exception`, but handling all of `did_throw`'s edge cases seems messier. Maybe not worth diverging over. This fix also uncovers a `man_spec.lua` bug on Windows: exceptions are thrown due to Windows missing `man`, but they're lost; skip these tests if `man` isn't executable.
* refactor: replace char_u with charDundar Goc2022-08-25
| | | | Work on https://github.com/neovim/neovim/issues/459
* test(treesitter): make internal lang test pending when necessaryThomas Vigouroux2022-08-24
|
* Merge pull request #19906 from bfredl/bigstagebfredl2022-08-24
|\ | | | | perf(api): allow to use an arena for return values
| * refactor(arena): use a shared block freelistbfredl2022-08-24
| | | | | | | | | | This is both simpler in client code and more effective (always reuse block hottest in cache)
* | vim-patch:9.0.0206: redraw flags are not named specifically (#19913)zeertzjq2022-08-23
|/ | | | | Problem: Redraw flags are not named specifically. Solution: Prefix "UPD_" to the flags, for UPDate_screen(). https://github.com/vim/vim/commit/a4d158b3c839e96ed98ff87c7b7124ff4518c4ff
* fix(api/command): fargs behavior when no arguments are passed (#19862)Javier Lopez2022-08-21
| | | | | | | Problem: A command defined with `nargs="?"` returns `fargs={""}` to a Lua callback when executed with no arguments, which is inconsistent with how`nargs="*"` behaves. Solution: Pass `fargs={}` for no argument with `nargs="?"` as well.
* vim-patch:8.1.1886: command line expansion code is spread out (#19861)zeertzjq2022-08-21
| | | | | Problem: Command line expansion code is spread out. Solution: Move the code to cmdexpand.c. (Yegappan Lakshmanan, closes vim/vim#4831) https://github.com/vim/vim/commit/66b51420e0c8d49bcf6786b792c938d6099e3393
* vim-patch:8.1.2057: the screen.c file is much too bigLewis Russell2022-08-19
| | | | | | | | | | | | | | | Problem: The screen.c file is much too big. Solution: Split it in three parts. (Yegappan Lakshmanan, closes vim/vim#4943) https://github.com/vim/vim/commit/7528d1f6b5422750eb778dfb550cfd0b0e540964 This is an approximation vim-patch 8.1.2057. Applying the patch directly isn't feasible since our version of screen.c has diverged too much, however we still introduce drawscreen.c and drawline.c: - screen.c is now a much smaller file used for low level screen functions - drawline.c contains everything needed for win_line() - drawscreen.c contains everything needed for update_screen() Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* fix(source): fix expand('<sfile>') no longer works for Luazeertzjq2022-08-16
|
* fix(source): make changing 'shellslash' change expand() resultzeertzjq2022-08-15
|
* refactor: change remaining sourcing_name/sourcing_lnum to exestackzeertzjq2022-08-14
| | | | Co-Authored-By: VVKot <volodymyr.kot.ua@gmail.com>