| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Work towards enabling ["flow" layout](https://github.com/neovim/neovim/blob/9244da12e400ec0291450a5e9400d995e7a29b83/src/gen/gen_help_html.lua#L86-L88)
in all `:help` files.
Problem:
The final boss of vimdoc pseudo-structure: Vim's quasi-headings on
function signatures and excmd docs is visually distinctive but too
inconsistent for a nice parse rule.
Solution:
- Define the quasi-heading format as an "h4" variant, specified at
`:help help-tag-heading`.
- For simplicity and predictability, it is defined as any line that
ends with a help tag(s) preceded by 2 or more spaces (or 1 tab).
- Update existing docs.
- This one-time update has a lot of changes, but is very unlikely to
conflict with ported Vim-patches because (1) Vim rarely adds new
*excmds* that we want, and (2) *function* docs are auto-generated.
ref https://github.com/neovim/tree-sitter-vimdoc/issues/110
|
| |
|
|
|
|
|
|
|
|
| |
Work towards enabling "flow" layout in most `:help` files.
Since [tables are supported in help](https://github.com/neovim/tree-sitter-vimdoc#tables),
it's now possible to render most help files as ["flow" layout](https://github.com/neovim/neovim/blob/9244da12e400ec0291450a5e9400d995e7a29b83/src/gen/gen_help_html.lua#L86-L88)
instead of the legacy fixed-width layout. Besides [improved HTML rendering](https://github.com/neovim/neovim/pull/42381#discussion_r4285705739),
flow layout will allow `:help` presentation-mode to un-hardwrap text
blocks.
|
| |
|
| |
highlights.scm: `#match` is slow, prefer `#lua-match`.
|
| |
|
|
|
| |
Generate PDF using `chrome`.
TODO: we probably don't need the `typst` codepath.
|
| |
|
|
|
|
| |
Render tables in both `:help` and generated HTML.
Use NBSP (nonbreaking space) char in empty table cells.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
- `<` before a listitem (`< - foo`) is not concealed.
- Codeblock HTML has extra blank lines.
- Codeblock in a listitem ends the listitem, so HTML docs drop the rest
of the item and its nesting. Example from `:h nvim_open_win()`:
```
• border: … the double-box style can be specified as: >
[ "╔", "═" ,"╗", "║", "╝", "═", "╚", "║" ].
<
If fewer than eight chars are given, they will be repeated.
• bufpos: …
tree-sitter-vimdoc v4.1.0:
(block
(line_li (prefix) (line) (codeblock (code (line)))))
(block
(line) ; "If fewer…"
(line_li (prefix) (line) (line))) ; "bufpos"
tree-sitter-vimdoc v4.2.0:
(block
(line_li (prefix) (line) (codeblock (code (line)))
(line)) ; "If fewer…"
(line_li (prefix) (line) (line))) ; "bufpos"
```
Solution:
- Bump tree-sitter-vimdoc to v4.2.0. https://github.com/neovim/tree-sitter-vimdoc/pull/174
- gen_help_html: get listitem indent from its first line
- gen_help_html: don't double codeblock newlines.
- highlight query: conceal `<` in `line_li`.
- docs: fix doc sources where a blank line was missing after listitems
followed by non-listitem text.
|
| |
|
|
|
|
|
|
|
|
| |
Problem:
API contract was relaxed by 25439dad7e2ba21ff2f78759c68be888a217342c40581
to treat `opts` params as optional. However, when called from Vimscript,
omitting the `opts` arg `E119: Not enough arguments for function` error.
Solution:
Add a min/max argument range in the Vimscript generator if the function
has an `opts_idx` field.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
- annotation-usage-error and code-style-check are disabled.
- vim.inspect relies on a dummy self-assignment for docgen, and its help
omits parameter and option details.
- LuaLS fallback types obscure iterator inference.
- Docgen hardcodes public function names and appends separately sorted
files, leaving shared helpers under the inspector heading.
Solution:
- Enable annotation-usage-error and code-style-check, and fix misplaced
annotations.
- Document vim.inspect's callable module directly, removing the dummy
assignment. Describe its parameters, option defaults and process
callback.
- Remove LuaLS iterator fallbacks, correct iterator signatures and check
values that the improved inference identifies as optional.
- Parse callable modules, require bindings and parent module references.
Derive public names and inherited function docs from these links,
including missing help for vim.async.semaphore() and vim.version().
- Export vim.lsp.tagfunc directly with lazy loading and document its
implementation instead of maintaining a wrapper.
- Group files in section_order, replacing append_only and merge_files.
Merge declarations before sorting each section, placing shared helpers
in the main vim section and keeping vim.inspect in alphabetical order.
- Add basic parser coverage for callable modules and module links.
AI-assisted
|
| |
|
|
|
|
|
|
|
|
|
| |
Problem: Command inputs and parsed modifiers have different optional
fields, and completion window IDs are annotated as floating-point
values.
Solution: Separate modifier input and return types, correct integer IDs,
and update the metadata generators and their output.
AI-assisted
|
| |
|
|
| |
AI-assisted
|
| |
|
|
|
|
|
|
| |
Return-cast annotations refine types but do not add return values.
Recognize them before @return and exclude them from rendered docs. Apply
narrowing to vim.isnil() without changing its runtime behavior.
AI-assisted
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The generated vim.fn stubs represent overloads as repeated function
declarations. EmmyLua merges their return types, so getline(lnum) is
inferred as string|string[] even though it always returns a string.
Generate one declaration with @overload annotations from the existing
__N entries, while keeping separate Vimdoc signatures. Parenthesize the
overload return list so types such as (0|-1)[] remain arrays.
Correct getline()'s single-line and range signatures, and add typed
getqflist() signatures for its entry-list and property-query forms. This
lets callers infer quickfix results without local type overrides.
AI-assisted
|
| |
|
|
| |
CI is currently using clang-tidy 21 but prepare for the future
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
nvim_set_option_value() with dry_run=true accepts invalid values such as
foldmethod='nonsense'. Validation is mixed with side effects in the
did_set_* callbacks, so dry runs skip it.
Solution:
Split value validation out of the did_set_* callbacks into separate
validation_cb callbacks. Use these checks for both normal assignments
and nvim_set_option_value() dry runs. Keep side effects in did_set_*.
Replace direct foldenable/foldlevel assignments in C folding commands
with setters. This gives C commands the same OptionSet and
synchronization behavior as Lua assignments.
Use normal setters for 'tabstop' and 'vartabstop' in :retab so C code
indentation and folds based on indentation use the new tab widths.
Direct assignments could leave them using the old widths.
:retab temporarily turns off 'list' to calculate tab widths. Previously,
:retab -1 reported an error and returned without restoring 'list'. Check
the argument before turning 'list' off, so an invalid argument leaves
the option unchanged.
AI-assisted
|
| |
|
|
|
|
|
|
|
|
| |
Make gen_helptags.lua call help.lua instead of keeping its own tag
parser. Builds and :helptags now use the same code.
Allow the shared code to run without Neovim, and fail the build when tag
generation reports an error.
AI-assisted
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- call-non-callable
- missing-fields
- redefined-label
- redefined-local
- undefined-field
- unreachable-code
Promote redefined-local and unreachable-code to warnings.
Fix DOS line-ending handling for multiline semantic tokens, and support
intersection types in the help parser.
AI-assisted
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: LuaLS struggles with the generics used in Nvim's runtime,
requiring broad diagnostic suppressions. Indexing is also slow.
Solution: Use EmmyLua for type checks in the build and CI. It offers
more sophisticated type checking, substantially better support for
generics, and much better flow analysis.
Correct the affected annotations. Use `@internal`, supported directly by
EmmyLua, instead of `@nodoc` for shared internal declarations, and
support it in the help parser.
AI-assisted
|
| |
|
|
|
|
|
|
|
|
| |
Problem: K on generic and nullable type annotations can jump to the
wrong help tag. Generated See references repeat the type names.
Solution: Strip generic arguments and nullable suffixes when resolving
help tags. Remove the redundant generated See references.
AI-assisted
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: Nvim has many Lua APIs that start callback-driven work: timers,
jobs, libuv handles, and other event-loop tasks. Callers that need to
sequence or cancel that work have to build their own coroutine wrappers,
task bookkeeping, and cleanup rules. This makes async control flow hard
to share, test, and document.
Solution: Add `vim.async`, a structured-concurrency module vendored from
async.nvim. It provides task handles, await/pawait helpers,
sleep/timeout helpers, completion-order iteration, and semaphores on top
of Nvim's event loop.
The API follows the same broad model as Trio: async work has an owner,
tasks are awaited explicitly, and cancellation is cooperative. Include
generated vimdoc with an introductory overview and examples, a news
entry, and functional tests for the new module.
AI-assisted
|
| | |
|
| |
|
|
|
|
|
|
| |
Problem:
gen_help_html.lua only outputs HTML, but Typst is useful for producing PDFs.
Solution:
Add gen_one_typ() and ts_node_to_typ(), which mirror the existing
gen_one_html() and ts_node_to_html().
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Problem:
The runs ":helptags", which needs the tree-sitter-vimdoc parser.
This may cause problems for package maintainers / distros?
Solution:
Use running to generate the tags, like the zig build already does.
It also errors on duplicate tags, which is good.
The `:helptags` command still uses treesitter.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
Parent commit regressed some behavior of the old C helptags-gen impl:
- helpfiles in sub-directories are named by basename, so :help fails
- "help-tags" always names "tags", never "tags-nl"
- E150 E151 E152 E153 are never reported
- existing tags file is not overwritten if no tags were found
- a duplicate tag aborts the run, skipping the remaining directories
- `*.TXT` and `*.FRX` (uppercase) are not recognized as helpfiles
- tree-sitter-vimdoc accepts tags that the C parser rejected: `*a|b*`
(breaks |links|) and unterminated `*tag`
- PUC Lua "<" compares with (localized) `strcoll()`, so the tags file is
not sorted by byte value (E432)
- requiring `vim.treesitter` at load time breaks :help itself, not just
:helptags, where the module is unavailable
- `vim.pack` runs :helptags for plugins that have no "doc/" directory,
so every install/update emits E150
Solution:
- Fail the build if generating helptags reports any `v:errmsg`.
- Restore old behavior: tags generated for runtime/doc are now identical
to those from the C implementation. Errors are non-fatal messages
instead of exceptions, so all directories are still processed.
- Load treesitter lazily, report a plain error if parser is missing.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
":call nvim_get_mode()" logs a nonsense channel-id:
RPC: ch 9223372036854775808: invoke nvim_get_mode
Solution:
Check `is_internal_call`.
Also, skip this logging for RPC calls, because it's redundant with
`log_request`/`log_notify`.
API: vim -> nvim_get_mode
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
Cannot assign Lua functions/closures to "func" ('completefunc',
'tagfun', …) or "expr" ('foldexpr', 'indentexpr', …) options.
Solution:
- Store "func"/"expr" options as `Callback` instead of string.
- Delete oceans of copy-pasted code.
- BREAKING: LuaRef returned via RPC/Vimscript is now represented as
`"<Lua N: file:line>"` (like what `:map` shows) instead of `nil`.
- Note: `man.vim` still uses `v:lua` string, bc it's a vimscript ftplugin.
Helped-by: Lewis Russell <lewis6991@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
Latent bug from 7f6c14ed54a46e822b80134d39a89f97523a2706 (2015).
If an option default is "false" (`o.defaults.if_false = false`, e.g.
'fileignorecase'), codegen does not give it a `.def_val` on the platform
where its `#if` condition is undefined; it is zero-initialized.
This wasn't noticed until the parent commit, where zero value is
kObjectTypeNil, which `set_option_varp()` rejects.
Solution:
Check `if_false == nil` insteada of "falsey", so the `#else` branch gets
generated.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
The object subsystem has an intermediate representation for no real
reason. Besides the code cost, this also adds an extra (api <=> OptVal)
conversion step, which is a (small) perf cost.
Solution:
We already have `Object`, so use it instead.
- drop `OptVal`, `OptValData`, `OptValType`, and related boilerplate.
- add `kObjectTypeUnset`.
|
| | |
|
| |
|
|
| |
- drop w_maxwidth/w_maxheight, calculate them on-demand from
'previewpopup' (this is cheap bc of `opt_keyset`)
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
The parent commit made a valiant effort to store "dict options" in their
reified form, but this is more trouble than it's worth:
- inconsistent model for developers to understand.
- string lifetime issues (the "varp" convention is to pass around an
aliased, long-lived option value).
- lots of extra plumbing to deal with the 2 different option-storage
paradigms.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
Options parsing is still painful for dict-style options.
Solution:
schema-maxxing => better `opt:get()` (will be the basis for `vim.o()`),
unified (and more-detailed) err msgs.
- Drop bespoke structure-builder in `_core/options.lua`.
- Define `schema` for all non-primitive options (except 'guicursor' and
statusline-style options); generate reified keysets `OptKeyDict`).
- Generate 'fillchars' => `fcs_tab`, 'listchars' => `lcs_tab`.
- `nvim_set_option_value`:
- Return the improved structures. Also from `vim.opt.x:get()`.
- Eliminate api <=> lua roundtrip, centralize option structure
handling.
- Improve/unify errors.
- Bump ERR_BUFLEN 80 → 256 so the "one of" list isn't truncated.
- Eliminate old 'diffopt' order-dependence (`iwhiteall` before `iwhite`)
Error samples:
Typed-key path (opt_strings_check → diffopt/mousescroll/breakindentopt):
E474: Unknown item 'foo'
E474: 'context' requires a number
E474: 'ver' number is out of range
E474: 'algorithm' must be one of: myers, minimal, patience, histogram
E474: 'filler' does not take a value
Related:
- #31084
- #34661
- #31820
- #14739
- #20107
- fix #18875
- :get() returns `{ sbr = true, shift = '3' }` (reified-keyset) instead of `{'sbr', 'shift:3'}`
- Setting via table now works too. `object_as_optval_for` `is_map` now recognizes struct options.
- fix #30296
- instead of `E474: Invalid argument`, errors now look like:
```
E474: Invalid value 'x', expected one of: single, double: ambiwidth=x
E474: Unknown item 'foo': diffopt=foo
E474: 'context' requires a number: diffopt=context:x
```
simplify `win_float_parse_option` from #26799.
|
| |
|
|
|
|
|
|
|
|
| |
Problem:
Generated API bindings for Lua contain unused jump labels when the API
function has a non-KeyDict (e.g., Array) param after a KeyDict param, causing
the build to fail.
Solution:
Don't output a label when the current parameter is not a KeyDict but the
previous one is.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
The list-item indentation logic in `gen_help_html.lua` tracks `opt.indent` that
only decrements by one level when a list item is less indented than its sibling.
Dedenting across multiple nesting levels at once produces the wrong left margin.
Solution:
Track the exact leading whitespace for each indent level in a `opt.indent_ws` stack:
- On reset or a top-level item initialize the stack with the current item's
whitespace.
- When indenting deeper push the current whitespace at the new level.
- When dedenting pop every level whose tracked whitespace is deeper than the
current item (reaching the correct ancestor level).
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
After 25439dad7e2b, `opts` is optional, but not params that follow it.
Solution:
- Update `gen_api_dispatch.lua`, docs, tests.
- Enhance the `nvim_get_api_info()` api-metadata to include a boolean
flag indicating whether a parameter is optional:
```
[type, name, optional]
```
Note: Currently, optional params are assumed to be Dict/Array. Since we
don't yet have any use-cases of optional params following `opts`, the
build just checks this assumption and we can deal with it later if we
ever care to:
nvim_get_hl: optional param "foo" has type "Integer" but (currently)
we assume Dict/Array
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Problem:
|api-contract| allows adding an optional trailing `opts` parameter, but
the dispatch generator still requires every parameter, so `opts` cannot
be omitted.
Solution:
Treat a trailing `Dict(...) *opts` parameter as optional in the generated
RPC and Lua dispatch wrappers.
Co-authored-by: Judit Novak <judit.novak@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Problem:
`getchar.c` is a quirky name and doesn't align with our existing
`os/input.c` and `tui/input.c` modules, which encompass the same topic
at different layers.
Solution:
Rename `getchar.c` => `input.c` for discoverability.
Introduce `dialog.c` for functionality related to showing confirm
prompts, dialogs, etc.
|
| |
|
|
|
|
|
| |
Problem: nvim_cmd() accepts number/boolean in args and converts them
to strings, but the keyset declares ArrayOf(String).
Solution: use ArrayOf(Union(Integer, String, Boolean)) and wrap union
types in parens when generating array annotations.
|
| |
|
|
|
|
|
|
|
|
|
| |
ArrayOf metadata existed before the LuaCATS type documentation refactor and is
useful to typed clients consuming api_info().
Keep Tuple metadata normalized to Array, since tuple element types can be mixed,
but preserve ArrayOf(...) for exported API metadata.
Fixes #38734
AI-assisted: Codex
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
cmdwin (the `:q` cmdline buffer) has various limitations which require
special-casing all over the codebase.
Besides complicating the code, it also breaks async plugins if they try
to create buffers/windows after some work is done, if the user happens
to open cmdwin at the wrong the moment:
Lua callback: …/guh.nvim/lua/guh/util.lua:531:
E11: Invalid in command-line window; <CR> executes, CTRL-C quits
stack traceback:
[C]: in function 'nvim_buf_delete'
…/guh.nvim/lua/guh/util.lua:531: in function <…/guh.nvim/lua/guh/util.lua:526>
Solution:
Just say no to "inception". Reimplement cmdwin as a normal buffer+window.
All of the cmdwin contortions (in both core, and innocent plugins) exist
literally only to support "inception": recursive
cmdwin-in-cmdline-things, like `<c-r>=`, `/`, search-during-substitute,
`:input()`, etc. So we just won't support that (though I have
a potential plan for that later, which I call "modal parking lot").
The benefit is that plugins, and core, no longer have to care about
cmdwin.
BONUS:
- mouse-drag on vertical separators works (it only worked for
horizontal/statusline before)
- inccommand-in-cmdwin now works correctly, for free (thus don't need
#40077).
POTENTIAL FOLLOWUPS
- Drop `CHECK_CMDWIN` ("E11: Invalid in command-line window"), allow chaos.
- Unify `BUFLOCK_OK` / `LOCK_OK` ?
DESIGN:
- Eliminate lots of C globals, `EX_CMDWIN`, etc.
- `text_locked()` no longer reports true for cmdwin.
- cmdwin = a normal window with 'winfixbuf', 'bufhidden=wipe',
'buftype=nofile'. Invariants come from those options rather than
special cases throughout the codebase.
- `nv_record` for q:/q//q? calls Lua
`nlua_call_vimfn("vim._core.cmdwin", …)`. No `K_CMDWIN`
/ cmdline-reader detour.
- `cedit_key` (`c_CTRL-F`) schedules a deferred event that calls
`vim._core.cmdwin.open(type, content, pos)` and returns `Ctrl_C` so
the in-flight cmdline cancels. Reader state is not serialized; instead
the captured `(type, line, col)` is replayed via
`nvim_feedkeys(type..line.."<CR>", "nt", …)` after user confirms.
- On confirm/cancel: `<CR>` / `<C-C>` calls into Lua which closes the
window and re-feeds the cmdline.
BREAKING CHANGES:
- Expression-register cmdline (`<C-R>=` from insert-mode) no longer
supports cmdwin. Same applies to `input()` / `inputlist()` (already
covered by `text_locked`).
- Usage of cmdwin in macros/mappings will probably break (assuming they
ever worked).
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was originally used because we needed a lua interpreter to run the
standalone _busted_ lua application (except we used fuckery behind the
scenes to fake its binary dependencies with our own binary
dependencies). Now we longer do that, we instead run `test.harness` as a
standard nvim -l script. as this mode is no longer used in tests it
risks going to bitrot anyway.
NB: -ll mode still had some theoretical benefits like quicker
initialization and more "native" printing behavior, etc.
But we can incrementally work on "nvim -l" mode instead
of maintaining a separate special thing.
|
| |
|
|
| |
invocation of cross-compilation changed, see news.txt blurb
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Pro |