summaryrefslogtreecommitdiffstatshomepage
path: root/src/nvim/lua/executor.c
AgeCommit message (Collapse)AuthorFiles
2022-12-03refactor: make sure getting a callback doesn't modify argumentzeertzjq1
2022-11-28feat(secure): add `:trust` command and vim.secure.trust() (#21107)Jlll11
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>
2022-11-17feat(exrc): use vim.secure.read() for 'exrc' optionGregory Anders1
2022-11-15Merge pull request #20157 from dundargoc/build/iwyubfredl1
build: allow IWYU to fix includes for all .c files
2022-11-15build: allow IWYU to fix includes for all .c filesdundargoc1
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.
2022-11-14ci(windows): treat compiler warnings as errorsdundargoc1
Reduce the warning level from 3 to 1 and fix all warnings.
2022-11-07feat(api): add command name to Lua command callback optsFamiu Haque1
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.
2022-11-01build(lint): remove clint.py rules for braces #20880dundargoc1
Uncrustify is the source of truth where possible. Remove any redundant checks from clint.py. See also https://github.com/neovim/neovim/pull/18563
2022-10-15refactor: replace char_u with charDundar Göc1
Work on https://github.com/neovim/neovim/issues/459
2022-09-28fix(lua): fix architecture-dependent behavior in usercmd "reg" (#20384)zeertzjq1
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.
2022-09-22fix(redraw): avoid unnecessary redraws and glitches with floats+messagesbfredl1
fixes #20106 fixes #20229
2022-09-18vim-patch:8.1.0941: macros for MS-Windows are inconsistent (#20215)dundargoc1
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
2022-09-16vim-patch:8.2.3796: the funcexe_T struct members are not named consistently ↵zeertzjq1
(#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.
2022-09-16vim-patch:8.2.0067: ERROR_UNKNOWN clashes on some systems (#20212)zeertzjq1
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.
2022-09-11refactor: replace char_u with charDundar Göc1
Work on https://github.com/neovim/neovim/issues/459
2022-09-09refactor: replace char_u with charDundar Göc1
Work on https://github.com/neovim/neovim/issues/459
2022-09-07refactor(typval): change FC_CFUNC abstraction into FC_LUAREFbfredl1
"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.
2022-09-02fix(api)!: correctly deal with number before :tabzeertzjq1
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.
2022-09-01feat(api): add support for :horizontal modifierzeertzjq1
2022-08-31feat(lua): vim.ui_attach to get ui events from luabfredl1
Co-authored-by: Famiu Haque <famiuhaque@protonmail.com>
2022-08-30fix(exceptions): restore `did_throw` (#20000)Sean Dewar1
`!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.
2022-08-25refactor: replace char_u with charDundar Goc1
Work on https://github.com/neovim/neovim/issues/459
2022-08-24test(treesitter): make internal lang test pending when necessaryThomas Vigouroux1
2022-08-24Merge pull request #19906 from bfredl/bigstagebfredl1
perf(api): allow to use an arena for return values
2022-08-24refactor(arena): use a shared block freelistbfredl1
This is both simpler in client code and more effective (always reuse block hottest in cache)
2022-08-23vim-patch:9.0.0206: redraw flags are not named specifically (#19913)zeertzjq1
Problem: Redraw flags are not named specifically. Solution: Prefix "UPD_" to the flags, for UPDate_screen(). https://github.com/vim/vim/commit/a4d158b3c839e96ed98ff87c7b7124ff4518c4ff
2022-08-21fix(api/command): fargs behavior when no arguments are passed (#19862)Javier Lopez1
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.
2022-08-21vim-patch:8.1.1886: command line expansion code is spread out (#19861)zeertzjq1
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
2022-08-19vim-patch:8.1.2057: the screen.c file is much too bigLewis Russell1
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>
2022-08-16fix(source): fix expand('<sfile>') no longer works for Luazeertzjq1
2022-08-15fix(source): make changing 'shellslash' change expand() resultzeertzjq1
2022-08-14refactor: change remaining sourcing_name/sourcing_lnum to exestackzeertzjq1
Co-Authored-By: VVKot <volodymyr.kot.ua@gmail.com>
2022-08-14vim-patch:8.2.0056: execution stack is incomplete and inefficientzeertzjq1
Problem: Execution stack is incomplete and inefficient. Solution: Introduce a proper execution stack and use it instead of sourcing_name/sourcing_lnum. Create a string only when used. https://github.com/vim/vim/commit/1a47ae32cdc19b0fd5a82e19fe5fddf45db1a506 Omit test_debugger.vim: superseded by later patches. Omit check_map_keycodes(): N/A. Omit kword_test.c: N/A (converted to a unit test).
2022-08-12refactor: remove some unused includes (#19740)zeertzjq1
Mostly avoids including eval.h, ex_cmds2.h and ex_docmd.h in other headers.
2022-08-11refactor: use CLEAR_FIELD and CLEAR_POINTER macros (#19709)zeertzjq1
vim-patch:8.2.0559: clearing a struct is verbose Problem: Clearing a struct is verbose. Solution: Define and use CLEAR_FIELD() and CLEAR_POINTER(). https://github.com/vim/vim/commit/a80faa8930ed5a554beeb2727762538873135e83
2022-08-06vim-patch:8.1.1210: support for user commands is spread out (#19653)zeertzjq1
Problem: Support for user commands is spread out. No good reason to make user commands optional. Solution: Move user command support to usercmd.c. Always enable the user_commands feature. https://github.com/vim/vim/commit/ac9fb18020d7e8bf16d02d45fbb02cf47328aaf7
2022-08-03feat(lua): print source locations of lua callbacks (#19597)ii141
Co-authored-by: ii14 <ii14@users.noreply.github.com>
2022-07-31Merge pull request #19437 from dundargoc/refactor/char_u-to-charbfredl1
refactor: replace char_u with char
2022-07-31docs: fix typos (#19024)dundargoc1
Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: Valery Viktorovsky <viktorovsky@gmail.com>
2022-07-31refactor: replace char_u with charDundar Goc1
Work on https://github.com/neovim/neovim/issues/459
2022-07-22refactor: move FunPtr to types.h (#19466)zeertzjq1
This type itself is not eval-specific. Moving it to types.h can avoid including eval/funcs.h in many headers, and types.h is already included by many headers.
2022-07-19fix(lua): make it possible to cancel vim.wait() with Ctrl-C (#19217)JP1
2022-07-09feat(lua): measure require in --startuptimeii141
2022-07-03feat(api): add `unsilent` to command APIszeertzjq1
2022-07-03vim-patch:8.2.1900: Vim9: command modifiers do not workzeertzjq1
Problem: Vim9: command modifiers do not work. Solution: Make most command modifiers work. https://github.com/vim/vim/commit/02194d2bd54eacd0b7b9a017a3fe1702ecb80971
2022-06-16fix(lua): clear got_int when calling vim.on_key() callback (#18979)zeertzjq1
2022-06-14Merge pull request #18947 from zeertzjq/vim-8.2.1897zeertzjq1
vim-patch:8.2.{1897,1898,5088}
2022-06-14vim-patch:8.2.5088: value of cmod_verbose is a bit complicated to usezeertzjq1
Problem: Value of cmod_verbose is a bit complicated to use. Solution: Use zero for not set, value + 1 when set. (closes vim/vim#10564) https://github.com/vim/vim/commit/cd7496382efc9e6748326c6cda7f01003fa07063 Omit has_cmdmod(): only used for Vim9 script
2022-06-14vim-patch:8.2.1898: command modifier parsing always uses global cmdmodzeertzjq1
Problem: Command modifier parsing always uses global cmdmod. Solution: Pass in cmdmod_T to use. Rename struct fields consistently. https://github.com/vim/vim/commit/e10044015841711b989f9a898d427bcc1fdb4c32
2022-06-14vim-patch:8.2.1897: command modifiers are saved and set inconsistentlyzeertzjq1
Problem: Command modifiers are saved and set inconsistently. Solution: Separate parsing and applying command modifiers. Save values in cmdmod_T. https://github.com/vim/vim/commit/5661ed6c833e05467cab33cb9b1c535e7e5cc570 Cherry-pick: :0verbose fix from patch 8.2.4741