aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/command.c
Commit message (Collapse)AuthorAge
* fix(api): "emsg_silent" should imply "silent" in nvim_cmd (#21438)zeertzjq2022-12-16
|
* docs: add missing docs from some Vim patches (#21296)zeertzjq2022-12-05
| | | | | | | | | | | | This is cherry-picked from these Vim patches: Only applicable change outside vi_diff.txt in patch 8.1.1226: https://github.com/vim/vim/commit/6c60f47fb9251e686217d51cf81847e14d0dd26d Most changes outside starting.txt and vi_diff.txt in patch 8.1.1280: https://github.com/vim/vim/commit/25c9c680ec4dfbb51f4ef21c3460a48d3c67ffc8 Missing docs for 'mousemoveevent': https://github.com/vim/vim/commit/cbaff5e06ec525d31dc44093125c42029e01d508
* docs(gen): support language annotation in docstringsChristian Clason2022-12-02
|
* 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.
* 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.
* Merge pull request #20364 from zeertzjq/parse-cmd-omitbfredl2022-09-30
|\ | | | | fix(api)!: nvim_parse_cmd omit "count" "range" "reg" if not supported
| * fix(api)!: nvim_parse_cmd omit "count" "range" "reg" if not supportedzeertzjq2022-09-30
| |
* | feat(nvim_cmd): allow using first argument as countFamiu Haque2022-09-29
|/ | | | | Allows `nvim_cmd` to use the first argument as count for applicable commands. Also adds support for non-String arguments to `nvim_cmd`.
* fix(api): fix nvim_cmd crash with filename expansion (#20397)zeertzjq2022-09-29
|
* 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.
* 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
* 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
|
* fix(api): nvim_exec and nvim_cmd restore msg_col when capturing output (#19789)zeertzjq2022-08-16
| | | | This matches the code in execute_common(), preventing messages after the API call from being printed at the wrong column.
* refactor: move non-symbols in ex_eval.h to ex_eval_defs.h (#19739)zeertzjq2022-08-12
| | | | This avoids including ex_eval.h in any other header, thus preventing future circular includes.
* refactor: use CLEAR_FIELD and CLEAR_POINTER macros (#19709)zeertzjq2022-08-11
| | | | | | | 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
* fix(api): `vim.cmd.make` crashes when argument count isn't 1 (#19701)Famiu Haque2022-08-10
| | | Closes #19696
* vim-patch:8.1.1210: support for user commands is spread out (#19653)zeertzjq2022-08-06
| | | | | | | 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
* feat(lua): print source locations of lua callbacks (#19597)ii142022-08-03
| | | Co-authored-by: ii14 <ii14@users.noreply.github.com>
* refactor(cmd): unify execute_cmd with do_one_cmdLewis Russell2022-08-02
|
* refactor: fix clang and PVS warnings (#19569)zeertzjq2022-07-29
| | | | The last commit didn't actually disable V1028 because of a typo. Fix the typo so it is actually disabled.
* perf(api): optimize nvim_cmd (#19513)Lewis Russell2022-07-27
| | | | | | | | | | | | | | | | | | | | | | Reduce the amount of string allocations and length calculations. With the following benchmark: ```lua total = 0 for _ = 1, loops do local start = now() vim.api.nvim_cmd({cmd = 'let', args = {'a', '=', '1'}}, {}) total = total + (now() - start) end print('nvim_cmd', total / loops) ``` ``` hyperfine 'nvim --clean test.lua +source +q' ``` Before: 234.5ms After: 173.8ms
* fix(api): make nvim_cmd mods.silent work correctly (#19489)notomo2022-07-25
|
* feat(api): add `unsilent` to command APIszeertzjq2022-07-03
|
* feat(api): make `nvim_parse_cmd` and `nvim_cmd` support :filterFamiu Haque2022-06-28
| | | | | | Also fixes a memory leak in `parse_cmdline`. Closes #18954.
* refactor: replace char_u #18429dundargoc2022-06-28
| | | Work on https://github.com/neovim/neovim/issues/459
* fix(inccommand): parse the command to check if it is previewableFamiu Haque2022-06-28
| | | | | Free regprog if command isn't previewable Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* docs: fix typos (#18866)dundargoc2022-06-15
| | | | | | | docs: fix typos and similarly insignificant changes Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: smjonas <jonas.strittmatter@gmx.de> Co-authored-by: kanreki <32443233+kanreki@users.noreply.github.com>
* vim-patch:8.2.5088: value of cmod_verbose is a bit complicated to usezeertzjq2022-06-14
| | | | | | | | 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
* vim-patch:8.2.1898: command modifier parsing always uses global cmdmodzeertzjq2022-06-14
| | | | | | 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
* refactor(api): remove redundant fields of CmdParseInfozeertzjq2022-06-14
|
* vim-patch:8.2.1897: command modifiers are saved and set inconsistentlyzeertzjq2022-06-14
| | | | | | | | | 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
* refactor(api): move command related API to separate filebfredl2022-06-12