summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/lua/vim/text.lua
AgeCommit message (Collapse)AuthorFiles
2025-07-12fix(lua): vim.diff is nil in uv.new_work() thread #34909Justin M. Keyes1
Problem: The "gitsigns" plugin runs `vim.diff` in a thread (`uv.new_work`), but `vim.diff` is nil in that context: Lua callback: …/gitsigns.nvim/lua/gitsigns/diff_int.lua:30: bad argument #1 to 'decode' (string expected, got nil) stack traceback: [C]: in function 'decode' …/gitsigns.nvim/lua/gitsigns/diff_int.lua:30: in function <…/gitsigns.nvim/lua/gitsigns/diff_int.lua:29> Luv thread: …/gitsigns.nvim/lua/gitsigns/diff_int.lua:63: attempt to call field 'diff' (a nil value) Solution: Revert the `stdlib.c` change (set `vim.diff` instead of `vim._diff`).
2025-07-12refactor(lua): rename vim.diff => vim.text.diff #34864Justin M. Keyes1
Problem: `vim.diff()` was introduced before we had the `vim.text` module, where it obviously belongs. Solution: Move it.
2025-06-06fix: type fixesLewis Russell1
Type fixes caught by emmylua
2025-02-26feat(lua): vim.text.indent()Justin M. Keyes1
Problem: Indenting text is a common task in plugins/scripts for presentation/formatting, yet vim has no way of doing it (especially "dedent", and especially non-buffer text). Solution: Introduce `vim.text.indent()`. It sets the *exact* indentation because that's a more difficult (and thus more useful) task than merely "increasing the current indent" (which is somewhat easy with a `gsub()` one-liner).
2024-11-26perf(vim.text): use lookup table implementation for hex encoding (#30080)Gregory Anders1
Co-authored-by: glepnir <glephunter@gmail.com>
2024-08-17fix(vim.text): handle very long strings (#30075)Gregory Anders1
Lua's string.byte has a maximum (undocumented) allowable length, so vim.text.hencode fails on large strings with the error "string slice too long". Instead of converting the string to an array of bytes up front, convert each character to a byte one at a time.
2024-05-31fix(vim.text): remove assert from vim.text.hexdecodeGregory Anders1
Instead, return nil plus an error message if the input is invalid.
2024-03-16refactor(lua): type annotationsLewis Russell1
2024-01-02fix(docs): clean up non-docstring comments for vimdoc genJongwook Choi1
These non-docstring comments can be included into doxygen's brief description and then appear in the succeeding function documentation.
2023-11-16feat: add vim.text module (#26069)Gregory Anders1