diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-03-20 18:59:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-20 18:59:20 +0100 |
commit | e7391191e27768dc6d603f3846d9b4e09c003cb5 (patch) | |
tree | 6f3782c905dfe1ee23939fc7353b876fe26095e9 /test | |
parent | af427dedf663b1987fa54c5f885409ad51824a20 (diff) | |
parent | 6eca9b69c4a1f40f27a6b41961af787327259de8 (diff) | |
download | rneovim-e7391191e27768dc6d603f3846d9b4e09c003cb5.tar.gz rneovim-e7391191e27768dc6d603f3846d9b4e09c003cb5.tar.bz2 rneovim-e7391191e27768dc6d603f3846d9b4e09c003cb5.zip |
Merge pull request #17776 from bfredl/tsconceal
feat(ui): allow conceal to be defined in decorations
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/treesitter/highlight_spec.lua | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/functional/treesitter/highlight_spec.lua b/test/functional/treesitter/highlight_spec.lua index ed28d8a37d..5ec0a8a060 100644 --- a/test/functional/treesitter/highlight_spec.lua +++ b/test/functional/treesitter/highlight_spec.lua @@ -672,6 +672,46 @@ describe('treesitter highlighting', function() ]]} end) + it("supports conceal attribute", function() + if pending_c_parser(pending) then return end + insert(hl_text) + + -- conceal can be empty or a single cchar. + exec_lua [=[ + vim.opt.cole = 2 + local parser = vim.treesitter.get_parser(0, "c") + test_hl = vim.treesitter.highlighter.new(parser, {queries = {c = [[ + ("static" @keyword + (set! conceal "R")) + + ((identifier) @Identifier + (set! conceal "") + (eq? @Identifier "lstate")) + ]]}}) + ]=] + + screen:expect{grid=[[ + /// Schedule Lua callback on main loop's event queue | + {4:R} int nlua_schedule(lua_State *const ) | + { | + if (lua_type(, 1) != LUA_TFUNCTION | + || != ) { | + lua_pushliteral(, "vim.schedule: expected function"); | + return lua_error(); | + } | + | + LuaRef cb = nlua_ref(, 1); | + | + multiqueue_put(main_loop.events, nlua_schedule_event, | + 1, (void *)(ptrdiff_t)cb); | + return 0; | + ^} | + {1:~ }| + {1:~ }| + | + ]]} + end) + it("hl_map has the correct fallback behavior", function() exec_lua [[ local hl_map = vim.treesitter.highlighter.hl_map |