about summary refs log tree commit diff stats
path: root/src/kilo.c
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-11-11 16:42:02 -0800
committerKartik K. Agaram <vc@akkartik.com>2021-11-11 16:42:02 -0800
commitd303c6efb0ee91d6adfae977908ff63c18f51e96 (patch)
treef7b1fd014124811f1faaec0833e01cbaa5411cec /src/kilo.c
parent0d6378aa51f8dfb1f0b1c175a8f56223232d9f52 (diff)
downloadteliva-d303c6efb0ee91d6adfae977908ff63c18f51e96.tar.gz
pass lua_State into editor
Diffstat (limited to 'src/kilo.c')
-rw-r--r--src/kilo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/kilo.c b/src/kilo.c
index e8cb618..35aa577 100644
--- a/src/kilo.c
+++ b/src/kilo.c
@@ -1164,7 +1164,7 @@ void editorMoveCursor(int key) {
  * is typing stuff on the terminal. */
 #define KILO_QUIT_TIMES 3
 int Quit = 0;
-void editorProcessKeypress(int fd) {
+void editorProcessKeypress(lua_State* L, int fd) {
     int c = editorReadKey(fd);
     switch(c) {
     case ENTER:
@@ -1255,14 +1255,14 @@ void initEditor(void) {
     signal(SIGWINCH, handleSigWinCh);
 }
 
-void edit(char* filename, char* message) {
+void edit(lua_State* L, char* filename, char* message) {
     initEditor();
     editorOpen(filename);
     enableRawMode(STDIN_FILENO);
     editorSetStatusMessage(message);
     while(!Quit) {
         editorRefreshScreen();
-        editorProcessKeypress(STDIN_FILENO);
+        editorProcessKeypress(L, STDIN_FILENO);
     }
     disableRawMode(STDIN_FILENO);
 }