aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/text.lua
Commit message (Collapse)AuthorAge
* fix(lua): vim.diff is nil in uv.new_work() thread #34909Justin M. Keyes2025-07-12
| | | | | | | | | | | | | | | | 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`).
* refactor(lua): rename vim.diff => vim.text.diff #34864Justin M. Keyes2025-07-12
| | | | | | | | Problem: `vim.diff()` was introduced before we had the `vim.text` module, where it obviously belongs. Solution: Move it.
* fix: type fixesLewis Russell2025-06-06
| | | | Type fixes caught by emmylua
* feat(lua): vim.text.indent()Justin M. Keyes2025-02-26
| | | | | | | | | | | | | 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).
* perf(vim.text): use lookup table implementation for hex encoding (#30080)Gregory Anders2024-11-26
| | | Co-authored-by: glepnir <glephunter@gmail.com>
* fix(vim.text): handle very long strings (#30075)Gregory Anders2024-08-17
| | | | | | | | 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.
* fix(vim.text): remove assert from vim.text.hexdecodeGregory Anders2024-05-31
| | | | Instead, return nil plus an error message if the input is invalid.
* refactor(lua): type annotationsLewis Russell2024-03-16
|
* fix(docs): clean up non-docstring comments for vimdoc genJongwook Choi2024-01-02
| | | | | These non-docstring comments can be included into doxygen's brief description and then appear in the succeeding function documentation.
* feat: add vim.text module (#26069)Gregory Anders2023-11-16