aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/_meta
Commit message (Collapse)AuthorAge
...
* vim-patch:9.1.0883: message history cleanup is missing some tests (#31331)zeertzjq2024-11-24
| | | | | | | | | | | | Problem: message history cleanup is missing some tests Solution: Add tests, refactor common code into did_set_msghistory() (Shougo Matsushita) closes: vim/vim#16078 https://github.com/vim/vim/commit/9f860a14c308f7a9a27a6850d36790615717a710 Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com> Co-authored-by: Milly <milly.ca@gmail.com>
* refactor(options): impl default 'titlestring' by format flags #30843zshuzh2024-11-20
| | | | | | | Problem: Unnecessary C impl of default 'titlestring'. Solutin: Define it using format flags.
* fix(api): validation, documentation of hl_group #31195luukvbaal2024-11-16
| | | | | | | | Problem: Documentation for "hl_group" in nvim_buf_set_extmark() is unclear. "hl_group" in nvim_echo() does not accept highlight group id. Solution: Move documentation for highlight group name/id to first mention of hl_group. Update nvim_echo() to accept highlight group id.
* feat(ui): don't show unfocusable windows in :tabs, 'tabline' #27984luukvbaal2024-11-16
| | | | | | | Problem: Floating windows with focusable set to false can reasonably be expected to be UI elements but are listed in some outputs that should contain only regular windows. Solution: Hide unfocusable floating windows from the default tabline and :tabs.
* docs: standardize doc for ChanInfo/ChanOpen autocmds/v:event (#31099)errael2024-11-16
|
* fix(ui): no fast context for prompt message kinds #31224luukvbaal2024-11-15
| | | | | | | Problem: No longer able to show prompt messages with vim.ui_attach(). Solution: Do not execute callback in fast context for prompt message kinds. These events must be safe to show the incoming message so the event itself serves to indicate that the message should be shown immediately.
* vim-patch:9.1.0864: message history is fixed to 200 (#31215)zeertzjq2024-11-15
| | | | | | | | | | | | Problem: message history is fixed to 200 Solution: Add the 'msghistory' option, increase the default value to 500 (Shougo Matsushita) closes: vim/vim#16048 https://github.com/vim/vim/commit/4bd9b2b2467e696061104a029000e9824c6c609e Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com> Co-authored-by: Milly <milly.ca@gmail.com>
* fix(messages)!: vim.ui_attach message callbacks are unsafeLuuk van Baal2024-11-14
| | | | | | | | Problem: Lua callbacks for "msg_show" events with vim.ui_attach() are executed when it is not safe. Solution: Disallow non-fast API calls for "msg_show" event callbacks. Automatically detach callback after excessive errors. Make sure fast APIs do not modify Nvim state.
* docs: misc (#30914)dundargoc2024-11-09
| | | | | | | Co-authored-by: Ernie Rael <errael@raelity.com> Co-authored-by: Famiu Haque <famiuhaque@proton.me> Co-authored-by: Jade <spacey-sooty@proton.me> Co-authored-by: glepnir <glephunter@gmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* feat(options)!: disallow setting hidden options #28400Famiu Haque2024-11-04
| | | | | | | | | | | | | | | | | Problem: There are three different ways of marking an option as hidden, `enable_if = false`, `hidden = true` and `immutable = true`. These also have different behaviors. Options hidden with `enable_if = false` can't have their value fetched using Vim script or the API, but options hidden with `hidden = true` or `immutable = true` can. On the other hand, options with `hidden = true` do not error when trying to set their value, but options with `immutable = true` do. Solution: Remove `enable_if = false`, remove the `hidden` property for options, and use `immutable = true` to mark an option as hidden instead. Also make hidden option variable pointers always point to the default value, which allows fetching the value of every hidden option using Vim script and the API. This does also mean that trying to set a hidden option will now give an error instead of just being ignored.
* vim-patch:9.1.0831: 'findexpr' can't be used as lambad or Funcref (#31058)zeertzjq2024-11-03
| | | | | | | | | | | | | Problem: 'findexpr' can't be used for lambads (Justin Keyes) Solution: Replace the findexpr option with the findfunc option (Yegappan Lakshmanan) related: vim/vim#15905 closes: vim/vim#15976 https://github.com/vim/vim/commit/a13f3a4f5de9c150f70298850e34747838904995 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:b5e7da1: runtime(doc): mention 'iskeyword' at :h charclass() (#31026)zeertzjq2024-11-01
| | | | | | | fixes: vim/vim#15965 https://github.com/vim/vim/commit/b5e7da1f27241f7d770d342009e2fb443e45e6ce Co-authored-by: Christian Brabandt <cb@256bit.org>
* docs(options): shell-powershell #30969Kai Moschcau2024-10-29
| | | | | | | `-NonInteractive` at least somewhat hints to pwsh/powershell, that shell sessions created from :! are not interactive, though even that is not foolproof, because powershell is weird. `$PSStyle.OutputRendering='plaintext'` causes pwsh/powershell to omit ANSI escape sequences in its output.
* vim-patch:9.1.0821: 'findexpr' completion doesn't set v:fname to cmdline ↵zeertzjq2024-10-29
| | | | | | | | | | | argument Problem: 'findexpr' completion doesn't set v:fname to cmdline argument. Solution: Set v:fname to the cmdline argument as-is (zeertzjq). closes: vim/vim#15934 https://github.com/vim/vim/commit/20e045f78148c0ef0143c33ffe686fee72d29376
* vim-patch:9.1.0810: cannot easily adjust the |:find| commandzeertzjq2024-10-29
| | | | | | | | | | | | Problem: cannot easily adjust the |:find| command Solution: Add support for the 'findexpr' option (Yegappan Lakshmanan) closes: vim/vim#15901 closes: vim/vim#15905 https://github.com/vim/vim/commit/aeb1c97db5b9de4f4903e7f288f2aa5ad6c49440 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* feat(stdlib): overload vim.str_byteindex, vim.str_utfindex #30735Tristan Knight2024-10-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PROBLEM: There are several limitations to vim.str_byteindex, vim.str_utfindex: 1. They throw given out-of-range indexes. An invalid (often user/lsp-provided) index doesn't feel exceptional and should be handled by the caller. `:help dev-error-patterns` suggests that `retval, errmsg` is the preferred way to handle this kind of failure. 2. They cannot accept an encoding. So LSP needs wrapper functions. #25272 3. The current signatures are not extensible. * Calling: The function currently uses a fairly opaque boolean value to indicate to identify the encoding. * Returns: The fact it can throw requires wrapping in pcall. 4. The current name doesn't follow suggestions in `:h dev-naming` and I think `get` would be suitable. SOLUTION: - Because these are performance-sensitive, don't introduce `opts`. - Introduce an "overload" that accepts `encoding:string` and `strict_indexing:bool` params. ```lua local col = vim.str_utfindex(line, encoding, [index, [no_out_of_range]]) ``` Support the old versions by dispatching on the type of argument 2, and deprecate that form. ```lua vim.str_utfindex(line) -- (utf-32 length, utf-16 length), deprecated vim.str_utfindex(line, index) -- (utf-32 index, utf-16 index), deprecated vim.str_utfindex(line, 'utf-16') -- utf-16 length vim.str_utfindex(line, 'utf-16', index) -- utf-16 index vim.str_utfindex(line, 'utf-16', math.huge) -- error: index out of range vim.str_utfindex(line, 'utf-16', math.huge, false) -- utf-16 length ```
* docs: miscdundargoc2024-10-23
| | | | | | | Co-authored-by: David Pedersen <limero@me.com> Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: Leo Schlosser <Leo.Schlosser@Student.HTW-Berlin.de> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* docs(options): remove description for hidden options #30903Famiu Haque2024-10-22
| | | | | | | | | Problem: Hidden options are documented despite being no-ops. Solution: Remove docs for hidden options. Move tags for options that we plan to restore, to ":help nvim-missing". Move tags for permanently removed options, to ":help nvim-removed".
* fix(meta): do not use hyphens in param namesLewis Russell2024-10-21
| | | | Fixes #30882
* feat(float): allow enabling mouse for non-focusable window (#30844)zeertzjq2024-10-20
| | | | Problem: Cannot allow mouse interaction for non-focusable float window. Solution: Add a "mouse" field to float window config.
* feat(terminal)!: make 'belloff' and 'visualbell' apply to terminal bell (#30859)zeertzjq2024-10-20
| | | | | | | vim-patch:8.2.4744: a terminal window can't use the bell vim-patch:8.2.4745: using wrong flag for using bell in the terminal BREAKING CHANGE: Bells from :terminal are now silent by default, unless 'belloff' option doesn't contain "term" or "all".
* Merge pull request #30825 from lewis6991/refactor/lsputilLewis Russell2024-10-17
|\
| * feat(meta): add type for quickfix entriesLewis Russell2024-10-17
| |
* | vim-patch:6c2fc37: runtime(help): Update help syntaxzeertzjq2024-10-17
|/ | | | | | | | | | | | | | | | | This commit makaes the following changes to the vim help syntax: - fix excessive URL detection in help, because `file:{filename}` in doc/options.txt is determined to be a URL. - update highlighting N for :resize in help - split Italian-specific syntax into separate help script - highlight `Note` in parentheses in help - update 'titlestring' behaviour in documentation for invalid '%' format closes: vim/vim#15883 https://github.com/vim/vim/commit/6c2fc377bfbfb6f1a46b1061413cd21116b596ed Co-authored-by: Milly <milly.ca@gmail.com>
* fix(runtime): clean up one-off scriptsChristian Clason2024-10-15
| | | | | | | | | | | | | | | | | | | | Problem: Some runtime files no longer spark joy. Solution: Kondo the place up. Still sparks _some_ joy (moved to new `runtime/scripts` folder): * `macros/less.*` * `mswin.vim` * `tools/emoji_list.lua` No longer sparks joy (removed): * `macmap.vim` (gvimrc file; not useful in Nvim) * `tools/check_colors.vim` (no longer useful with new default colorscheme and treesitter) * `macros/editexisting.vim` (throws error on current Nvim) * `macros/justify.vim` (obsolete shim for `packadd! justify`) * `macros/matchit.vim` (same) * `macros/shellmenu.vim` (same) * `macros/swapmous.vim` (same)
* vim-patch:9.1.0785: cannot preserve error position when setting quickfix ↵zeertzjq2024-10-15
| | | | | | | | | | | | | | list (#30820) Problem: cannot preserve error position when setting quickfix lists Solution: Add the 'u' action for setqflist()/setloclist() and try to keep the closes target position (Jeremy Fleischman) fixes: vim/vim#15839 closes: vim/vim#15841 https://github.com/vim/vim/commit/27fbf6e5e8bee5c6b61819a5e82a0b50b265f0b0 Co-authored-by: Jeremy Fleischman <jeremyfleischman@gmail.com>
* vim-patch:5bcfb5a: runtime(doc): add some docs for file-watcher programszeertzjq2024-10-15
| | | | | | | | fixes: vim/vim#15733 https://github.com/vim/vim/commit/5bcfb5a30cfd8e8574061bdd82a192f47aae09b5 Co-authored-by: Christian Brabandt <cb@256bit.org>
* vim-patch:7b5e52d: runtime(doc): add preview flag to statusline examplezeertzjq2024-10-15
| | | | | | | | | | | | Problem: The standard statusline example is missing the preview flag "%w" Solution: Add the preview flag "%w" closes: vim/vim#15874 https://github.com/vim/vim/commit/7b5e52d16fb457c90cc44340a6190712aab7e03b Co-authored-by: saher <msaher.shair@gmail.com>
* vim-patch:9.1.0774: "shellcmdline" doesn't work with getcompletion() (#30750)zeertzjq2024-10-10
| | | | | | | | Problem: "shellcmdline" doesn't work with getcompletion(). Solution: Use set_context_for_wildcard_arg() (zeertzjq). closes: vim/vim#15834 https://github.com/vim/vim/commit/85f36d61e09b12d6f1c60201129823371daa4a84
* vim-patch:9.1.0770: current command line completion is a bit limited (#30728)zeertzjq2024-10-09
| | | | | | | | | | | Problem: current command completion is a bit limited Solution: Add the shellcmdline completion type and getmdcomplpat() function (Ruslan Russkikh). closes: vim/vim#15823 https://github.com/vim/vim/commit/0407d621bbad020b840ffbbbd25ba023bbc05edd Co-authored-by: Ruslan Russkikh <dvrussk@yandex.ru>
* docs: dev-arch, focusable windows #30510Justin M. Keyes2024-10-07
| | | | - 'statuscolumn' is no longer experimental - add tags for popular searches on neovim.io
* docs: generate params/returns in builtin.txt #30654Justin M. Keyes2024-10-07
|
* vim-patch:9.1.0762: 'cedit', 'termwinkey' and 'wildchar' may not be parsed ↵zeertzjq2024-10-07
| | | | | | | | | | | | | | | | | | | | | correctly (#30704) Problem: 'cedit', 'termwinkey' and 'wildchar' may not be parsed correctly Solution: improve string_to_key() function in option.c (Milly) - Problem: `^@` raises an error. Solution: Store as `<Nul>`. - Problem: `<t_xx` does not raise an error. Solution: Raise an error if closing `>` is missing. - Problem: Single `<` or `^` raises an error. It is inconvenient for users. Solution: They are stored as a single character. closes: vim/vim#15811 https://github.com/vim/vim/commit/a9c6f90918d0012d1b8c8c5c1dccb77407f553fb Co-authored-by: Milly <milly.ca@gmail.com>
* vim-patch:fd4e47e: runtime(doc): clarify the effect of 'startofline' option ↵zeertzjq2024-10-07
| | | | | | | | | (#30701) fixes: vim/vim#15794 https://github.com/vim/vim/commit/fd4e47e06b77fa26cb38f057aba950449e1f47f6 Co-authored-by: Christian Brabandt <cb@256bit.org>
* feat(docs): improve `@see` meta docstrings #30693Justin M. Keyes2024-10-06
|
* fix(runtime): fully port emoji_list to LuaChristian Clason2024-10-06
| | | | | | | Problem: `runtime/tools/emoji_list.vim` is a Lua script masquerading as Vimscript, which is unnecessary now that `:source` works for Lua files. Solution: Remove Vimscript wrapper.
* fix(docs): markdown instead of vimdoc in meta docstrings #30680Justin M. Keyes2024-10-06
| | | | | LuaLS/meta docstrings expect markdown, not vimdoc. This matters for lists, codeblocks, etc. Also, line length doesn't matter for docstrings.
* fix(docs): missing `@returns` desc in _meta/api.lua #30673Justin M. Keyes2024-10-05
|
* docs: render `@since` versions, 0 means experimental #30649Justin M. Keyes2024-10-04
| | | | | | | | An implication of this current approach is that `NVIM_API_LEVEL` should be bumped when a new Lua function is added. TODO(future): add a lint check which requires `@since` on all new functions. ref #25416
* docs: improve luacats support #30580James Trew2024-10-03
| | | | | | | Some composite/compound types even as basic as `(string|number)[]` are not currently supported by the luacats LPEG grammar used by gen_vimdoc. It would be parsed & rendered as just `string|number`. Changeset adds better support for these types.
* vim-patch:ae62fe5: runtime(doc): 'filetype', 'syntax' and 'keymap' only ↵zeertzjq2024-10-03
| | | | | | | | | allow alphanumeric + some characters (#30630) closes: vim/vim#15783 https://github.com/vim/vim/commit/ae62fe5c289e148b92b1d0bb912dcce7ebe14602 Co-authored-by: Milly <milly.ca@gmail.com>
* vim-patch:9.1.0754: fixed order of items in insert-mode completion menu (#30619)glepnir2024-10-03
| | | | | | | | | | | | | Problem: fixed order of items in insert-mode completion menu Solution: Introduce the 'completeitemalign' option with default value "abbr,kind,menu" (glepnir). Adding an new option `completeitemalign` abbr is `cia` to custom the complete-item order in popupmenu. closes: vim/vim#14006 closes: vim/vim#15760 https://github.com/vim/vim/commit/6a89c94a9eeee53481ced1a1260a177bffde4c0f
* vim-patch:9.1.0752: can set 'cedit' to an invalid value (#30616)zeertzjq2024-10-01
| | | | | | | | | | | Problem: can set cedit to an invalid value Solution: Check that the value is a valid key name (Milly) closes: vim/vim#15778 https://github.com/vim/vim/commit/25732435c56d762abb260499680939bd8882c708 Co-authored-by: Milly <milly.ca@gmail.com>
* test: refactor exec_lua in xdiff_specLewis Russell2024-09-30
|
* fix(diff): use mmfile_t in linematchLewis Russell2024-09-30
| | | | | | | | | | | | | | | Problem: Linematch used to use strchr to navigate a string, however strchr does not supoprt embedded NULs. Solution: Use `mmfile_t` instead of `char *` in linematch and introduce `strnchr()`. Also remove heap allocations from `matching_char_iwhite()` Fixes: #30505
* vim-patch:9.1.0741: No way to get prompt for input()/confirm()zeertzjq2024-09-26
| | | | | | | | | | | | Problem: No way to get prompt for input()/confirm() Solution: add getcmdprompt() function (Shougo Matsushita) (Shougo Matsushita) closes: vim/vim#15667 https://github.com/vim/vim/commit/6908428560a0d6ae27bf7af6fcb6dc362e31926c Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
* docs: render @see, @note items in _meta/api.lua #30494Justin M. Keyes2024-09-25
|
* docs: lua error patterns #30240Justin M. Keyes2024-09-24
| | | | Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net> Co-authored-by: Ananth Bhaskararaman <antsub@gmail.com>
* feat(paste): unify cancel and error behavior (#30476)zeertzjq2024-09-24
| | | | | | | | | | | | | | | | | | | | | | | | Before this PR, the behavior of nvim_paste is: - When vim.paste() returns false, return false to the client, but treat following chunks normally (i.e. rely on the client cancelling the paste as expected). - When vim.paste() throws an error, still return true to the client, but drain the following chunks in the stream without calling vim.paste(). There are two problems with such behavior: - When vim.paste() errors, the client is still supposed to send the remaining chunks of the stream, even though they do nothing. - Having different code paths for two uncommon but similar situations complicates maintenance. This PR makes both the cancel case and the error case return false to the client and drain the remaining chunks of the stream, which, apart from sharing the same code path, is beneficial whether the client checks the return value of nvim_paste or not: - If the client checks the return value, it can avoid sending the following chunks needlessly after an error. - If the client doesn't check the return value, chunks following a cancelled chunk won't be pasted on the server regardless, which leads to less confusing behavior.
* refactor(api)!: rename Dictionary => DictJustin M. Keyes2024-09-23
| | | | | | | | | | | | | | In the api_info() output: :new|put =map(filter(api_info().functions, '!has_key(v:val,''deprecated_since'')'), 'v:val') ... {'return_type': 'ArrayOf(Integer, 2)', 'name': 'nvim_win_get_position', 'method': v:true, 'parameters': [['Window', 'window']], 'since': 1} The `ArrayOf(Integer, 2)` return type didn't break clients when we added it, which is evidence that clients don't use the `return_type` field, thus renaming Dictionary => Dict in api_info() is not (in practice) a breaking change.