summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/lua/nvim
AgeCommit message (Collapse)AuthorFiles
2026-03-13refactor: rename _ensure_integer => _assert_integerJustin M. Keyes1
2026-03-12refactor: integer functions, optimize asserts #34112Lewis Russell1
refactor(lua): add integer coercion helpers Add vim._tointeger() and vim._ensure_integer(), including optional base support, and switch integer-only tonumber()/assert call sites in the Lua runtime to use them. This also cleans up related integer parsing in LSP, health, loader, URI, tohtml, and Treesitter code. supported by AI
2026-01-28refactor(lua): use vim.fs instead of fnamemodifyYochem van Rosmalen1
Although powerful -- especially with chained modifiers --, the readability (and therefore maintainability) of `fnamemodify()` and its modifiers is often worse than a function name, giving less context and having to rely on `:h filename-modifiers`. However, it is used plenty in the Lua stdlib: - 16x for the basename: `fnamemodify(path, ':t')` - 7x for the parents: `fnamemodify(path, ':h')` - 7x for the stem (filename w/o extension): `fnamemodify(path, ':r')` - 6x for the absolute path: `fnamemodify(path, ':p')` - 2x for the suffix: `fnamemodify(path, ':e')` - 2x relative to the home directory: `fnamemodify(path, ':~')` - 1x relative to the cwd: `fnamemodify(path, ':.')` The `fs` module in the stdlib provides a cleaner interface for most of these path operations: `vim.fs.basename` instead of `':t'`, `vim.fs.dirname` instead of `':h'`, `vim.fs.abspath` instead of `':p'`. This commit refactors the runtime to use these instead of fnamemodify. Not all fnamemodify calls are removed; some have intrinsic differences in behavior with the `vim.fs` replacement or do not yet have a replacement in the Lua module, i.e. `:~`, `:.`, `:e` and `:r`.
2025-12-06feat(spell): opt-out of confirm when downloading spellfiles #36836Olivia Kinnear1
2025-11-09refactor(spellfile): config() interface, docs #36481Yochem van Rosmalen1
Problem: - Exposing the raw config as table is a pattern not seen anywhere else in the Nvim codebase. - Old spellfile.vim docs still available, no new documentation Solution: - Exposing a `config()` function that both acts as "getter" and "setter" is a much more common idiom (e.g. vim.lsp, vim.diagnostic). - Add new documentation and link old docs to |spellfile.lua| instead of |spellfile.vim|.
2025-10-26refactor(spell): cleanupJustin M. Keyes1
- prefer `stdpath(data)/site/spell` instead of looking for random dirs in 'runtimepath'. - drop unused functions `choose_directory`, `setup`, etc.
2025-10-26refactor(spell): migrate to Lua, drop netrw dependencyTom Ampuero1
Problem: Spell file downloads relied on Vimscript and netrw (:Nread). If netrw is disabled, downloads fail. Solution: Port the logic to Lua as `nvim.spellfile` and wire it via a Lua plugin that handles `SpellFileMissing`. Use `vim.net.request()` with a timeout for HTTP, prompt via `vim.fn.input` and report via `vim.notify`. Closes #7189
2025-07-18fix(tutor): use invalidate field in nvim_buf_set_extmark() #34989Phạm Bình An1
Problem: If users delete a line containing extmark, it will move to the next line, which could highlight the next line in an unwanted way. Solution: - Use `invalidate` field in `nvim_buf_set_extmark()` to prevent the extmark from moving. - Also save from "priority" hacking, since we can check if the extmark is valid in `nvim_buf_get_extmarks()` now.
2025-07-18refactor(tutor): reimplement interactive marks as extmark in Luabrianhuster1
Problem: From https://matrix.to/#/!cylwlNXSwagQmZSkzs:matrix.org/$Ofj-TFIsEMbp0O9OhE8xuZSNi-nhRLtZTOgs6JRLNrs?via=matrix.org&via=gitter.im&via=mozilla.org In lesson 2.6, users are asked to remove the second, forth and fifth lines with `dd` command, then they are asked to undo twice to make the text go back to original state. But after that, the mark ✗ appears again, which confuses the user because they think they do something wrong. This is a limitation with the current implementation, which is based on line number only. Solution: Reimplement interactive marks as extmarks in Lua. This also make the feature less fragile, as users can remove, add some arbitrary lines without breaking the interactive marks. Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2024-05-19refactor!: remove `nvim` and `provider` module for checkhealthdundargoc1
The namespacing for healthchecks for neovim modules is inconsistent and confusing. The completion for `:checkhealth` with `--clean` gives ``` nvim provider.clipboard provider.node provider.perl provider.python provider.ruby vim.lsp vim.treesitter ``` There are now three top-level module names for nvim: `nvim`, `provider` and `vim` with no signs of stopping. The `nvim` name is especially confusing as it does not contain all neovim checkhealths, which makes it almost a decoy healthcheck. The confusion only worsens if you add plugins to the mix: ``` lazy mason nvim nvim-treesitter provider.clipboard provider.node provider.perl provider.python provider.ruby telescope vim.lsp vim.treesitter ``` Another problem with the current approach is that it's not easy to run nvim-only healthchecks since they don't share the same namespace. The current approach would be to run `:che nvim vim.* provider.*` and would also require the user to know these are the neovim modules. Instead, use this alternative structure: ``` vim.health vim.lsp vim.provider.clipboard vim.provider.node vim.provider.perl vim.provider.python vim.provider.ruby vim.treesitter ``` and ``` lazy mason nvim-treesitter telescope vim.health vim.lsp vim.provider.clipboard vim.provider.node vim.provider.perl vim.provider.python vim.provider.ruby vim.treesitter ``` Now, the entries are properly sorted and running nvim-only healthchecks requires running only `:che vim.*`.
2024-04-17fix(healthcheck): expand vimrc variable (#28379)Michael1
2024-04-16feat(defaults): use ripgrep (rg) for 'grepprg' if availableLuna Saphie Mittelbach1
2024-04-07fix(health): check unmatching python_glob as empty table (#28215)Barrett Ruth1
2024-04-06refactor: remove fn_booldundargoc1
It's better to use vim.fn directly instead of creating minor abstractions like fn_bool.
2024-03-12docs: small fixes (#27364)dundargoc1
Co-authored-by: C.D. MacEachern <craig.daniel.maceachern@gmail.com> Co-authored-by: Ynda Jas <yndajas@gmail.com> Co-authored-by: Owen Hines <TheOdd@users.noreply.github.com> Co-authored-by: Wanten <41904684+WantenMN@users.noreply.github.com> Co-authored-by: lukasvrenner <118417051+lukasvrenner@users.noreply.github.com> Co-authored-by: cuinix <915115094@qq.com>
2024-01-28fix(health): check more "old" filesJustin M. Keyes1
2024-01-22refactor: rewrite python provider in luadundargoc1
2024-01-04fix(health): fix tmux RGB capability detection (#26886)Tristan Partin1
tmux indicates its RGB support via setrgbb and setrgbf. In modern tmux code, Tc and RGB just set setrgbb and setrgbf, so we can just check for them. Link: https://github.com/tmux/tmux/commit/7eb496c00c313c2f8ab8debe6d154d5ac0db277b
2023-12-13docs: add installation and build guides from wiki to repodundargoc1
2023-09-24fix: checkhealth warning even if init.lua exists #25306Tom Blake1
Problem: `:checkhealth nvim` warns about missing vimrc if `init.lua` exists but `init.vim` does not. Solution: Check for any of: init.vim, init.lua, $MYVIMRC. Fix #25291
2023-06-03feat(lua): rename vim.loop -> vim.uv (#22846)Lewis Russell1
2023-04-15refactor: deprecate checkhealth functionsdundargoc1
The following functions are deprecated and will be removed in Nvim v0.11: - health#report_start() - health#report_info() - health#report_ok() - health#report_warn() - health#report_error() - vim.health.report_start() - vim.health.report_info() - vim.health.report_ok() - vim.health.report_warn() - vim.health.report_error() Users should instead use these: - vim.health.start() - vim.health.info() - vim.health.ok() - vim.health.warn() - vim.health.error()
2023-04-14feat(lua): vim.tbl_contains supports general tables and predicates (#23040)Christian Clason1
* feat(lua): vim.tbl_contains supports general tables and predicates Problem: `vim.tbl_contains` only works for list-like tables (integer keys without gaps) and primitive values (in particular, not for nested tables). Solution: Rename `vim.tbl_contains` to `vim.list_contains` and add new `vim.tbl_contains` that works for general tables and optionally allows `value` to be a predicate function that is checked for every key.
2023-02-06fix(health): iterate using ipairs correctly (#22119)Mateusz Majewski1
In a few places ipairs was used to iterate over elements of the array. However, the first return value of ipairs was erronously used, which is not the value, but rather the index. This would result in errors, for instance when trying to retrieve a field from the value.
2023-01-30refactor!: remove has("debug") (#22060)dundargoc1
This value can not be relied on as it doesn't work for multi-configuration generators. I don't think this undocumented option is used much, if at all, so I think we should remove it.
2023-01-16feat(health): detect tmux RGB support via `client_termfeatures`Sean Dewar1
Problem: On tmux v3.2+, the `terminal-features` option may be used to enable RGB capabilities over `terminal-overrides`. However, `show-messages` cannot be used to detect if RGB capabilities are enabled using `terminal-features`. Solution: Try to use `display-message -p #{client_termfeatures}` instead. The returned features include "RGB" if either "RGB" is set in `terminal-features`, or if "Tc" or "RGB" is set in `terminal-overrides` (as before). Nothing is returned by tmux versions older than v3.2, so fallback to checking `show-messages` in that case. Also, un-Vimscriptify the previous logic a bit, and change the error message to point to using the `terminal-features` option instead for newer tmux versions.
2023-01-16fix(health): fix `tmux_esc_time` comparisonSean Dewar1
Regression from the health.vim to .lua changes. Unlike Vim script, Lua does not implicitly convert strings to numbers, so this comparison threw an error.
2023-01-16health: migrate to Lua #21661TJ DeVries1
* refactor: remove all vimscript from nvim/health * fixup: previous method broke if you had a folder named 'x-lua'
2023-01-04docs: fix typos (#21427)dundargoc1
Co-authored-by: Gustavo Sampaio <gbritosampaio@gmail.com> Co-authored-by: C.D. MacEachern <craig.daniel.maceachern@gmail.com> Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com> Co-authored-by: Tomas Nemec <nemi@skaut.cz>
2022-11-11feat(checkhealth): use "help" syntax, avoid tabpage #20879Justin M. Keyes1
- If Nvim was just started, don't create a new tab. - Name the buffer "health://". - Use "help" syntax instead of "markdown". It fits better, and eliminates various workarounds. - Simplfy formatting, avoid visual noise. - Don't print a "INFO" status, it is noisy. - Drop the ":" after statuses, they are already UPPERCASE and highlighted.
2022-10-30feat(checkhealth): check runtime ($VIMRUNTIME)Justin M. Keyes1
Move man/health.lua into the "runtime" check. fix #20696
2022-10-30refactor(checkhealth): convert "nvim" check to LuaJustin M. Keyes1