aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/command_spec.lua
Commit message (Collapse)AuthorAge
* 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.
* 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(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(usercmd): also check for whitespace after escaped character (#19942)zeertzjq2022-08-25
|
* 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.
* feat(api): add `unsilent` to command APIszeertzjq2022-07-03
|
* fix(nvim_create_user_command): make `smods` work with `nvim_cmd`Famiu Haque2022-06-08
| | | | Closes #18876.
* feat: add preview functionality to user commandsFamiu Haque2022-05-31
| | | | Adds a Lua-only `preview` flag to user commands which allows the command to be incrementally previewed like `:substitute` when 'inccommand' is set.
* feat(nvim_create_user_command): pass structured modifiers to commandsFamiu Haque2022-05-29
| | | | | | | Adds an `smods` key to `nvim_create_user_command` Lua command callbacks, which has command modifiers but in a structured format. This removes the need to manually parse command modifiers. It also reduces friction in using `nvim_cmd` inside a Lua command callback.
* fix(api): correctly pass f-args for nvim_create_user_command (#18098)Gregory Anders2022-04-13
| | | | | Skip runs of whitespace and do not include `\` characters when followed by another `\` or whitespace. This matches the behavior of <f-args> when used with `:command`.
* refactor!: rename nvim_add_user_command to nvim_create_user_commandGregory Anders2022-04-10
|
* feat(test): use nvim_exec in helpers.source() #16064Justin M. Keyes2022-03-27
| | | | | | | | helpers.source() was a hack to work around the lack of anonymous :source. Its "create tempfile" behavior is not a required part of most tests that use it. Some tests still need the old "create tempfile" behavior either because they test SID behavior, or because of missing nvim_exec features: #16071
* 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 }
* fix(api): validate command names in nvim_add_user_command (#17406)Gregory Anders2022-02-15
| | | | This uses the same validation used when defining commands with `:command`.
* vim-patch:8.2.3584: "verbose set efm" reports location of the :compiler commandzeertzjq2022-01-21
| | | | | | | | Problem: "verbose set efm" reports the location of the :compiler command. (Gary Johnson) Solution: Add the "-keepscript" argument to :command and use it when defining CompilerSet. https://github.com/vim/vim/commit/58ef8a31d7087d495ab1582be5b7a22796ac2451
* feat(api): implement nvim_{add,del}_user_commandGregory Anders2021-12-28
| | | | | Add support for adding and removing custom user commands with the Nvim API.
* refactor(api): handle option dicts properlyBjörn Linse2021-10-03
| | | | | | | Do not copy a lot of lua strings (dict keys) to just strequal() them Just compare them directly to a dedicated hash function. feat(generators): HASHY McHASHFACE
* vim-patch:8.2.3141: no error when using :complete for :command without -nargsJan Edmund Lazo2021-08-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: No error when using :complete for :command without -nargs. Solution: Give an error. (Martin Tournoij, closes vim/vim#8544, closes vim/vim#8541) https://github.com/vim/vim/commit/de69a7353e9bec552e15dbe3706a9f4e88080fce N/A patches for version.c: vim-patch:8.1.1801: cannot build without the +eval feature Problem: Cannot build without the +eval feature. Solution: Always define funcexe_T. https://github.com/vim/vim/commit/505e43a20eb25674b18d73971fe3b51dad917f9a vim-patch:8.1.1818: unused variable Problem: Unused variable. Solution: Remove the variable. (Mike Williams) https://github.com/vim/vim/commit/b4a88a0441a65a0c9411c294825a08ca703f541e vim-patch:8.2.1464: Vim9: build warning for unused variable Problem: Vim9: build warning for unused variable. Solution: Delete the variable declaration. https://github.com/vim/vim/commit/829ac868b7615d73dbfb536f7fcd44fc7c5b7c1d vim-patch:8.2.2639: build failure when fsync() is not available Problem: Build failure when fsync() is not available. Solution: Add #ifdef. https://github.com/vim/vim/commit/5ea79a2599d35f75e1ae8a75d2711c754c4cb7c4 vim-patch:8.2.2814: Vim9: unused variable Problem: Vim9: unused variable. (John Marriott) Solution: Adjust #ifdef. https://github.com/vim/vim/commit/b06b50dfa06e1cbefd634e2735e7cd5ddd5b911c vim-patch:8.2.2947: build failure without the channel feature Problem: Build failure without the channel feature. Solution: Add back #ifdef. (John Marriott) https://github.com/vim/vim/commit/f5bfa8faa7bbe025c10148d37e8b47217a430a3b vim-patch:8.2.2976: build failure without the +eval feature Problem: Build failure without the +eval feature. Solution: Add #ifdefs. https://github.com/vim/vim/commit/8de901e1f1b051e02a61ae76ad7c925e4c0642e5 vim-patch:8.2.2986: build failure without the profile feature Problem: Build failure without the profile feature. Solution: Add #ifdef. https://github.com/vim/vim/commit/d9f31c13d217b4b97f724774a67a6d1f8640e8ae vim-patch:8.2.3114: Amiga-like systems: build error using stat() Problem: Amiga-like systems: build error using stat(). Solution: Only build swapfile_process_running() on systems where it is actually used. (Ola Söder, closes vim/vim#8519) https://github.com/vim/vim/commit/599a6e5b3629d943a795cd69e4d3d19886f86405
* test: Eliminate expect_errJustin M. Keyes2019-09-06
| | | | Eliminate `expect_err` in favor of `pcall_err` + `eq` or `matches`.
* tests: <SNR> is represented as 'R' (ASCII)Jan Edmund Lazo2018-07-12
|
* API: nvim_get_commands(): return DictionaryJustin M. Keyes2018-05-12
|
* API: nvim_get_commands(): builtin is irrelevant for buffer-localJustin M. Keyes2018-05-12
| | | | | builtin commands are never buffer-local, so we can return empty for that case.
* API: nvim_get_commands(): more attributesJustin M. Keyes2018-05-11
| | | | | | | Support more :command attributes: -bang -bar -register
* API: nvim_get_commands(): always return keysJustin M. Keyes2018-05-11
| | | | | | - Always return all keys, with at least NIL value. - Require `opts` param to be {"builtin":false} - Validate `opts` param
* API: nvim_get_commands()Nimit Bhardwaj2018-05-11