diff options
author | Matthieu Coudron <mattator@gmail.com> | 2020-07-21 23:03:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-21 23:03:14 +0200 |
commit | 326b87feb6179d1b36375844eab493e0bb4dbf7f (patch) | |
tree | 94a72386f2ee4f085ae56197277bec575e6105a4 /test/functional/lua/treesitter_spec.lua | |
parent | b059fb5c677ccc42104bd1a55ccb770186f4cc44 (diff) | |
parent | be057197d3b74df1886c3b5e2026276ef7c2116e (diff) | |
download | rneovim-326b87feb6179d1b36375844eab493e0bb4dbf7f.tar.gz rneovim-326b87feb6179d1b36375844eab493e0bb4dbf7f.tar.bz2 rneovim-326b87feb6179d1b36375844eab493e0bb4dbf7f.zip |
Merge pull request #12646 from vigoux/ts-fix-tilde
buffer_updates: set `deleted_bytes` correctly when hitting `~`
When doing bytebased update, we need to revisit this to let outer calls of ml_get_line handle the deleted part (will be more precise)
Diffstat (limited to 'test/functional/lua/treesitter_spec.lua')
-rw-r--r-- | test/functional/lua/treesitter_spec.lua | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/test/functional/lua/treesitter_spec.lua b/test/functional/lua/treesitter_spec.lua index 6ba4220849..aa3d55b06d 100644 --- a/test/functional/lua/treesitter_spec.lua +++ b/test/functional/lua/treesitter_spec.lua @@ -360,6 +360,52 @@ static int nlua_schedule(lua_State *const lstate) {8:}} | | ]]} + + feed("gg$") + feed("~") + screen:expect{grid=[[ + {2:/// Schedule Lua callback on main loop's event queu^E} | + {3:static} {3:int} nlua_schedule({3:lua_State} *{3:const} lstate) | + { | + {2:/*} | + {2: if (lua_type(lstate, 1) != LUA_TFUNCTION} | + {2: || lstate != lstate) {} | + {2: lua_pushliteral(lstate, "vim.schedule: expected function");} | + {2: return lua_error(lstate);} | + {2:*/} | + } | + | + {7:LuaRef} cb = nlua_ref(lstate, {5:1}); | + | + multiqueue_put(main_loop.events, nlua_schedule_event, | + {5:1}, ({3:void} *)({3:ptrdiff_t})cb); | + {4:return} {5:0}; | + {8:}} | + | + ]]} + + + feed("re") + screen:expect{grid=[[ + {2:/// Schedule Lua callback on main loop's event queu^e} | + {3:static} {3:int} nlua_schedule({3:lua_State} *{3:const} lstate) | + { | + {2:/*} | + {2: if (lua_type(lstate, 1) != LUA_TFUNCTION} | + {2: || lstate != lstate) {} | + {2: lua_pushliteral(lstate, "vim.schedule: expected function");} | + {2: return lua_error(lstate);} | + {2:*/} | + } | + | + {7:LuaRef} cb = nlua_ref(lstate, {5:1}); | + | + multiqueue_put(main_loop.events, nlua_schedule_event, | + {5:1}, ({3:void} *)({3:ptrdiff_t})cb); | + {4:return} {5:0}; | + {8:}} | + | + ]]} end) it('inspects language', function() |