Add lua interrupt on F9
This commit is contained in:
@@ -184,6 +184,14 @@ int LuaGetCurrentBufferDir(lua_State *L) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void HookLuaForceExit(lua_State *L, lua_Debug *debug) {
|
||||||
|
SDL_PumpEvents();
|
||||||
|
int numkeys = 0;
|
||||||
|
const uint8_t *keys = SDL_GetKeyboardState(&numkeys);
|
||||||
|
if (keys[SDL_SCANCODE_F9] > 0)
|
||||||
|
luaL_error(L, "lua execution got interrupted");
|
||||||
|
}
|
||||||
|
|
||||||
luaL_Reg LuaFunctions[] = {
|
luaL_Reg LuaFunctions[] = {
|
||||||
{ "Open", LuaOpen},
|
{ "Open", LuaOpen},
|
||||||
{ "ListBuffers", LuaListBuffers},
|
{ "ListBuffers", LuaListBuffers},
|
||||||
@@ -202,6 +210,7 @@ luaL_Reg LuaFunctions[] = {
|
|||||||
void InitLua() {
|
void InitLua() {
|
||||||
LuaState = luaL_newstate();
|
LuaState = luaL_newstate();
|
||||||
luaL_openlibs(LuaState);
|
luaL_openlibs(LuaState);
|
||||||
|
lua_sethook(LuaState, HookLuaForceExit, LUA_MASKCOUNT, 100000000);
|
||||||
|
|
||||||
for (int i = 0; LuaFunctions[i].name; i += 1) {
|
for (int i = 0; LuaFunctions[i].name; i += 1) {
|
||||||
lua_pushcfunction(LuaState, LuaFunctions[i].func);
|
lua_pushcfunction(LuaState, LuaFunctions[i].func);
|
||||||
|
|||||||
@@ -5,13 +5,15 @@ right_mouse :: ctrl exec word,alt go back
|
|||||||
|
|
||||||
|
|
||||||
ctrl mleft - add cursor
|
ctrl mleft - add cursor
|
||||||
ctrl shift mleft - add cursor + set selection
|
ctrl shift mleft - add cursor and set selection
|
||||||
alt mleft -
|
alt mleft -
|
||||||
alt ctrl mleft -
|
alt ctrl mleft -
|
||||||
alt shift mleft -
|
alt shift mleft -
|
||||||
|
mright - destroy pointed at selection and copy | copy line
|
||||||
alt mright - go back
|
alt mright - go back
|
||||||
mright - destroy pointed at selection and copy
|
|
||||||
ctrl mright - load word
|
ctrl mright - load word
|
||||||
shift mright -
|
shift mright -
|
||||||
|
alt shift mright -
|
||||||
|
alt ctrl mright -
|
||||||
ctrl shift mright - exec word
|
ctrl shift mright - exec word
|
||||||
mmiddle -
|
mmiddle -
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
- Remove pointers and use ViewIDs (enable array debug while doing this)
|
- Remove pointers and use ViewIDs (enable array debug while doing this)
|
||||||
- try using git grep for search for now, combine with fuzzy search buffer
|
- try using git grep for search for now, combine with fuzzy search buffer
|
||||||
- lua maybe try heuristic matching paths from left?
|
- lua maybe try heuristic matching paths from left?
|
||||||
- prevent lua from infinite looping
|
|
||||||
- Append to console and change console directory
|
- Append to console and change console directory
|
||||||
- win32: change all stack buffers to arena
|
- win32: change all stack buffers to arena
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user