aboutsummaryrefslogtreecommitdiff
path: root/test/functional/treesitter/highlight_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2025-02-21 02:02:32 +0100
committerJustin M. Keyes <justinkz@gmail.com>2025-02-26 23:06:22 +0100
commitbe1fbe38b31b6046d396407c4efbf238941c6b08 (patch)
tree697a429f5ac903d766c2faaf5044fa7a16eeea77 /test/functional/treesitter/highlight_spec.lua
parentf4921e2b7deb4812414998a521c33f920f571c20 (diff)
downloadrneovim-be1fbe38b31b6046d396407c4efbf238941c6b08.tar.gz
rneovim-be1fbe38b31b6046d396407c4efbf238941c6b08.tar.bz2
rneovim-be1fbe38b31b6046d396407c4efbf238941c6b08.zip
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).
Diffstat (limited to 'test/functional/treesitter/highlight_spec.lua')
-rw-r--r--test/functional/treesitter/highlight_spec.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/functional/treesitter/highlight_spec.lua b/test/functional/treesitter/highlight_spec.lua
index 6d59368a24..f3a321aa88 100644
--- a/test/functional/treesitter/highlight_spec.lua
+++ b/test/functional/treesitter/highlight_spec.lua
@@ -786,9 +786,9 @@ describe('treesitter highlighting (C)', function()
screen:expect({
grid = [[
- {26:int x = 4;} |
- {26:int y = 5;} |
- {26:int z = 6;} |
+ {26:int x = 4;} |
+ {26:int y = 5;} |
+ {26:int z = 6;} |
^ |
{1:~ }|*13
|
@@ -815,7 +815,7 @@ describe('treesitter highlighting (C)', function()
screen:expect({
grid = [[
- void foo(int {15:*}{25:bar}); |
+ void foo(int {15:*}{25:bar}); |
^ |
{1:~ }|*15
|
@@ -883,8 +883,8 @@ describe('treesitter highlighting (lua)', function()
screen:expect({
grid = [[
- {15:local} {25:ffi} {15:=} {16:require(}{26:'ffi'}{16:)} |
- {25:ffi}{16:.}{25:cdef}{16:(}{26:"}{16:int}{26: }{16:(}{15:*}{26:fun}{16:)(int,}{26: }{16:char}{26: }{15:*}{16:);}{26:"}{16:)} |
+ {15:local} {25:ffi} {15:=} {16:require(}{26:'ffi'}{16:)} |
+ {25:ffi}{16:.}{25:cdef}{16:(}{26:"}{16:int}{26: }{16:(}{15:*}{26:fun}{16:)(int,}{26: }{16:char}{26: }{15:*}{16:);}{26:"}{16:)} |
^ |
{1:~ }|*14
|
@@ -1185,7 +1185,7 @@ printf('Hello World!');
{18:```}{15:c} |
{25:printf}{16:(}{26:'Hello World!'}{16:);} |
{18:```} |
- ^ |
+ ^ |
|
]],
})
@@ -1271,7 +1271,7 @@ printf('Hello World!');
{8:120 }{25:printf}{16:(}{26:'Hello World!'}{16:);} |
{8:122 } |
{8:124 }{25:printf}{16:(}{26:'Hello World!'}{16:);} |
- {8:126 } ^ |
+ {8:126 }^ |
|
]])
end)