aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/keysets.lua
Commit message (Collapse)AuthorAge
* refactor(api): make typed dicts appear as types in the source codebfredl2023-04-07
| | | | | | | | | | | | | | | | | | | | | problem: can we have Serde? solution: we have Serde at home This by itself is just a change of notation, that could be quickly merged to avoid messy merge conflicts, but upcoming changes are planned: - keysets no longer need to be defined in one single file. `keysets.h` is just the initial automatic conversion of the previous `keysets.lua`. keysets just used in a single api/{scope}.h can be moved to that file, later on. - Typed dicts will have more specific types than Object. this will enable most of the existing manual typechecking boilerplate to be eliminated. We will need some annotation for missing value, i e a boolean will need to be represented as a TriState (none/false/true) in some cases. - Eventually: optional parameters in form of a `Dict opts` final parameter will get added in some form to metadata. this will require a discussion/desicion about type forward compatibility.
* feat(api): set statuscolumn line number in nvim_eval_statusline()Luuk van Baal2023-04-07
| | | | | | Having the user set `v:lnum` before calling `nvim_eval_statusline()` is unnecesarily fragile. Redraws inbetween setting `v:lnum` and the `nvim_eval_statusline()` call will overwrite `v:lnum`.
* feat(api): evaluate 'statuscolumn' with nvim_eval_statusline()Luuk van Baal2023-04-05
|
* feat(api): nvim_exec2(), deprecate nvim_exec() #19032Evgeni Chasnovski2023-03-25
| | | | | | | Problem: The signature of nvim_exec() is not extensible per ":help api-contract". Solution: Introduce nvim_exec2() and deprecate nvim_exec().
* feat(api): add nvim_get_hl (#22693)Null Chilly2023-03-23
| | | | | Problem: no way of getting all highlight group definitions in a namespace. Solution: add `nvim_get_hl()`, deprecate `nvim_get_hl_by_name()` and `nvim_get_hl_by_id()`.
* feat(api): add filetype option nvim_get_option_valueLewis Russell2023-03-20
| | | | | - Also adjust the expr-mapping behaviour so normal commands and text changes are allowed in internal dummy buffers.
* feat(highlight): define the concept of altfont as a (c)term rendering attributePaul "LeoNerd" Evans2023-01-24
|
* build: make generated source files reproducible #21586Arnout Engelen2023-01-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Build is not reproducible, because generated source files (.c/.h/) are not deterministic, mostly because Lua pairs() is unordered by design (for security). https://github.com/LuaJIT/LuaJIT/issues/626#issuecomment-707005671 https://www.lua.org/manual/5.1/manual.html#pdf-next > The order in which the indices are enumerated is not specified [...] > >> The hardening of the VM deliberately randomizes string hashes. This in >> turn randomizes the iteration order of tables with string keys. Solution: - Update the code generation scripts to be deterministic. - That is only a partial solution: the exported function (funcs_metadata.generated.h) and ui event (ui_events_metadata.generated.h) metadata have some mpack'ed tables, which are not serialized deterministically. - As a workaround, introduce `PRG_GEN_LUA` cmake setting, so you can inject a modified build of luajit (with LUAJIT_SECURITY_PRN=0) that preserves table order. - Longer-term we should change the mpack'ed data structure so it no longer uses tables keyed by strings. Closes #20124 Co-Authored-By: dundargoc <gocdundar@gmail.com> Co-Authored-By: Arnout Engelen <arnout@bzzt.net>
* fix(tui): more work in the TUIbfredl2022-12-31
|
* refactor(tui): use nvim_echo() for verbose terminfobfredl2022-12-20
| | | | | | This is needed for #18375 for the obvious reasons. note: verbose_terminfo_event is only temporarily needed until the full TUI process refactor is merged.
* feat(ui): add support to display a title in the border of a float (#20184)Raphael2022-11-06
| | | add "title" and "title_pos" keys to win config dict.
* feat(extmarks,ts,spell): full support for spellingThomas Vigouroux2022-09-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added 'spell' option to extmarks: Extmarks with this set will have the region spellchecked. - Added 'noplainbuffer' option to 'spelloptions': This is used to tell Neovim not to spellcheck the buffer. The old behaviour was to spell check the whole buffer unless :syntax was set. - Added spelling support to the treesitter highlighter: @spell captures in highlights.scm are used to define regions which should be spell checked. - Added support for navigating spell errors for extmarks: Works for both ephemeral and static extmarks - Added '_on_spell_nav' callback for decoration providers: Since ephemeral callbacks are only drawn for the visible screen, providers must implement this callback to instruct Neovim which regions in the buffer need can be spell checked. The callback takes a start position and an end position. Note: this callback is subject to change hence the _ prefix. - Added spell captures for built-in support languages Co-authored-by: Lewis Russell <lewis6991@gmail.com> Co-authored-by: Björn Linse <bjorn.linse@gmail.com>
* feat(api): add support for :horizontal modifierzeertzjq2022-09-01
|
* feat(ui): allow to set the highlight namespace per windowbfredl2022-08-17
| | | | | - reimplement 'winhl' in terms of highlight namespaces - check for EOF in screen tests (to indicate a likely crash)
* feat(api): add replace_keycodes to nvim_set_keymap (#19598)ii142022-08-01
|
* feat(api): add `unsilent` to command APIszeertzjq2022-07-03
|
* refactor(highlight)!: rename attributes to match Vim (#19159)zeertzjq2022-06-30
| | | | | | | | | Ref: https://github.com/vim/vim/commit/84f546363068e4ddfe14a8a2a2322bb8d3a25417 Rename: - `underlineline` to `underdouble` - `underdot` to `underdotted` - `underdash` to `underdashed` `underdouble` also now takes higher precedence than `undercurl`.
* feat(api): make `nvim_parse_cmd` and `nvim_cmd` support :filterFamiu Haque2022-06-28
| | | | | | Also fixes a memory leak in `parse_cmdline`. Closes #18954.
* feat(api): nvim__get_runtime do_sourcebfredl2022-06-11
|
* 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.
* Merge pull request #18528 from lewis6991/setwinoptbfredl2022-05-25
|\ | | | | feat(api): add `win` and `buf` to `nvim_set_option_value`
| * feat(api): add win and buf to nvim_set_option_valueLewis Russell2022-05-17
| | | | | | | | Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
* | feat(api): enable nvim_exec_autocmds to pass arbitrary data (#18613)Gregory Anders2022-05-18
| | | | | | | | Add a "data" key to nvim_exec_autocmds that passes arbitrary data (API objects) to autocommand callbacks.
* | feat(ui): add `'winbar'`Famiu Haque2022-05-18
|/ | | | | | | Adds support for a bar at the top of each window, enabled through the `'winbar'` option. Co-authored-by: Björn Linse <bjorn.linse@gmail.com>
* feat(api): add `nvim_cmd`Famiu Haque2022-05-11
| | | | Adds the API function `nvim_cmd` which allows executing an Ex-command through a Dictionary which can have the same values as the return value of `nvim_parse_cmd()`. This makes it much easier to do things like passing arguments with a space to commands that otherwise may not allow it, or to make commands interpret certain characters literally when they otherwise would not.
* feat(api/ui): win_extmarksYatao Li2022-05-03
|
* refactor(api)!: use singular/plural consistently in the autocmd APIGyörgy Andorka2022-03-31
|
* feat(api): nvim_clear_autocmdTJ DeVries2022-03-31
| | | | Co-authored-by: Christian Clason <christian.clason@uni-due.de>
* refactor!: rename nvim_do_autocmd to nvim_exec_autocmd (#17854)Javier Lopez2022-03-26
| | | according to established code standards (`:h dev-api`)
* feat(ui): allow conceal to be defined in decorationsbfredl2022-03-20
| | | | | | Unlike syntax conceal, change highlight of concealed char Can be used in tree-sitter using "conceal" metadata.
* feat(api): add 'buffer' argument to nvim_get_autocmds (#17594)Gregory Anders2022-03-06
| | | | | This enables retrieving autocommands defined in the given buffers. Under the hood this simply translates the buffer numbers into '<buffer=%d>' patterns.
* Merge pull request #16897 from lewis6991/signsbfredl2022-03-06
|\ | | | | feat(decorations): support signs
| * feat(decorations): support signsLewis Russell2022-03-05
| | | | | | | | | | | | | | | | | | | | | | | | Add the following options to extmarks: - sign_text - sign_hl_group - number_hl_group - line_hl_group - cursorline_hl_group Note: ranges are unsupported and decorations are only applied to start_row
* | feat(tui): add support for `CSI 4 : [2,4,5] m`Kirill Chibisov2022-03-03
|/ | | | | | | | This commit finishes support for colored and styled underlines adding `CSI 4 : [2,4,5] m` support providing double, dashed, and dotted underlines Fixes #17362.
* feat(lua): add missing changes to autocmds lost in the rebaseTJ DeVries2022-02-28
| | | | Note: some of these changes are breaking, like change of API signatures
* feat(lua): add api and lua autocmdsTJ DeVries2022-02-27
|
* feat(highlight): support for blend in nvim_set_hl (#17516)Lewis Russell2022-02-24
|
* feat(api): add strikethrough, nocombine to set_hlChristian Clason2022-02-12
|
* refactor(api): use a keyset for highlight dictsBjörn Linse2022-02-02
|
* 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(extmarks): add strict optionMichael Lingelbach2022-01-08
| | | | | | | | | The strict option, when set to false, allows placing extmarks on invalid row and column values greater than the maximum buffer row or line column respectively. This allows for nvim_buf_set_extmark to be a drop-in replacement for nvim_buf_set_highlight.
* feat(api): add support for lua function & description in keymapshadmansaleh2022-01-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Behavioral changes: 1. Added support for lua function in keymaps in -------------------------------------------- - nvim_set_keymap Can set lua function as keymap rhs like following: ```lua vim.api.nvim_{buf_}set_keymap('n', '<leader>lr', '', {callback = vim.lsp.buf.references}) ``` Note: lua function can only be set from lua . If api function being called from viml or over rpc this option isn't available. - nvim_{buf_}get_keymap When called from lua, lua function is returned is `callback` key . But in other cases callback contains number of the function ref. - :umap, nvim_del_keymap & nvim_buf_del_keymap clears lua keymaps correctly. - :map commands for displaing rhs . For lua keymaps rhs is displayed as <Lua function ref_no> Note: lua keymap cannot be set through viml command / functions. - mapargs() When dict is false it returns string in `<Lua function ref_no>` format (same format as :map commands). When dict is true it returns ref_no number in `callback` key. - mapcheck() returns string in `<Lua function ref_no>` format (same format as :map commands). 2. Added support for keymap description --------------------------------------- - nvim_{buf_}set_keymap: added `desc` option in opts table . ```lua vim.api.nvim_set_keymap('n', '<leader>w', '<cmd>w<cr>', {desc='Save current file'}) ``` - nvim_{buf_}get_keymap: contains `desc` in returned list. - commands like `:nmap <leader>w` will show description in a new line below rhs. - `maparg()` return dict contains `desc`.
* feat(api): implement nvim_{add,del}_user_commandGregory Anders2021-12-28
| | | | | Add support for adding and removing custom user commands with the Nvim API.
* fix(api): allow nvim_buf_set_extmark to accept end_row key (#16548)Gregory Anders2021-12-08
| | | | | | | nvim_buf_get_extmark uses "end_row" rather than "end_line" in its 'details' dict, which means callers must modify the key names if they want to re-use the information. Change the parameter name in nvim_buf_set_extmark to "end_row" and use "end_line" as an alias to make this more consistent.
* feat(api): add nvim_get_option_valueGregory Anders2021-12-04
|
* feat(api): evaluate statusline string #16020Famiu Haque2021-10-18
| | | | | | Adds API function `nvim_eval_statusline` to allow evaluating a statusline string and obtaining information regarding it. Closes https://github.com/neovim/neovim/issues/15849
* 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(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