diff options
author | Thomas Vigouroux <tomvig38@gmail.com> | 2020-07-16 09:28:18 +0200 |
---|---|---|
committer | Thomas Vigouroux <tomvig38@gmail.com> | 2020-07-21 19:18:04 +0200 |
commit | 2c34780c32c479950ee6c6797b5fbb88b0f9fd51 (patch) | |
tree | 60a52ef65e7a6b9f0b3eed41b6ffa096d390a60d /test/functional/lua/treesitter_spec.lua | |
parent | 409a1dcdc622368bd69559513df9c6a2f0c2f439 (diff) | |
download | rneovim-2c34780c32c479950ee6c6797b5fbb88b0f9fd51.tar.gz rneovim-2c34780c32c479950ee6c6797b5fbb88b0f9fd51.tar.bz2 rneovim-2c34780c32c479950ee6c6797b5fbb88b0f9fd51.zip |
buffer_updates: emit valid old_byte_size
Test this using treesitter highlighting, which is based on this
old_byte_size.
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() |