mirror of
https://github.com/neovim/neovim.git
synced 2026-04-28 02:04:10 +00:00
feat(lua): vim.text.indent()
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).
This commit is contained in:
@@ -316,13 +316,13 @@ test text
|
||||
|
||||
local grid_without_inlay_hints = [[
|
||||
test text |
|
||||
^ |
|
||||
^ |
|
||||
|
|
||||
]]
|
||||
|
||||
local grid_with_inlay_hints = [[
|
||||
{1:01234}test text |
|
||||
^ |
|
||||
^ |
|
||||
|
|
||||
]]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user