aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/pos
Commit message (Collapse)AuthorAge
* fix(lua): enable param-type-mismatch diagnosticLewis Russell2026-09-28
| | | | | | | | | Problem: Argument type mismatches are excluded from EmmyLua checks. Solution: Correct runtime annotations and calls, document local checker workarounds, and enable the diagnostic. AI-assisted
* build: enable more EmmyLua checksLewis Russell2026-09-09
| | | | | | | | | | Enable checks for unused code, deprecated calls, return types, and annotations. Fix the warnings and replace the deprecated highlight function. Keep exceptions where old APIs are still needed or the checker gets it wrong. AI-assisted
* fix(pos): `get_lines()` return empty table when file opening failsYi Ming2026-06-02
| | | | | | | | | | | | Problem: `get_lines()` may returns empty table when file opening fails, so every existing caller use `get_line() or ''` to avoid nil result. This also does not match the annotated return type of `get_line()`, which is `string` instead of `string?`. Solution: Make `get_line()` return empty string when file opening fails.
* fix(pos): `get_lines()` never correctly fallbacks to empty stringYi Ming2026-06-02
| | | | | | | | | Problem: `nvim_buf_get_lines` will always returns a table, so the `or` operator will never be used, letting `lines[row]` may be `nil` Solution: Fix it.
* refactor(pos): remove unnecessary code of `get_lines()`, tidy upYi Ming2026-06-02
| | | | | | | | | | Problem: `get_lines()` actually supports passing a `integer` instead of `integer[]`, but it is never used in this way, we use `get_line()` instead. Solution: Fix it. Also rename some variables to align with our current naming convention and use `vim.fn.readblob()` instead of a bunch of `uv` calls.
* refactor(pos,range): extract `vim.pos._util`Yi Ming2026-05-20
Problem: - To share logic, creating a `vim.Range` currently creates two `vim.Pos` values as intermediates, which causes unnecessary table allocations. - `pos.lua` and `range.lua` contain some overlapping logic. Solution: Add `vim.pos._util`, a module for handling positions represented directly by `row` and `col`.