dedup an enum

This commit is contained in:
Kartik K. Agaram 2021-11-26 16:26:13 -08:00
parent 5bc52a5cba
commit e699b5a052
3 changed files with 26 additions and 24 deletions

View File

@ -51,6 +51,7 @@
#include <fcntl.h>
#include "lua.h"
#include "teliva.h"
/* Syntax highlight types */
#define HL_NORMAL 0
@ -101,25 +102,6 @@ struct editorConfig {
static struct editorConfig E;
enum KEY_ACTION {
KEY_NULL = 0,
CTRL_B = 2,
CTRL_C = 3,
CTRL_D = 4,
CTRL_E = 5,
CTRL_F = 6,
CTRL_G = 7,
CTRL_H = 8,
TAB = 9,
ENTER = 10,
CTRL_L = 12,
CTRL_Q = 17,
CTRL_S = 19,
CTRL_U = 21,
CTRL_X = 24,
ESC = 27,
};
static void editorSetStatusMessage(const char *fmt, ...);
/* =========================== Syntax highlights DB =========================

View File

@ -20,6 +20,7 @@
#include "lua.h"
//? #include "lstate.h"
#include "teliva.h"
#include "lauxlib.h"
#include "lualib.h"
@ -631,11 +632,6 @@ int big_picture (lua_State *L) {
lua_settop(L, 0);
enum {
ENTER = 10,
CTRL_U = 21,
ESC = 27,
};
char query[CURRENT_DEFINITION_LEN+1] = {0};
int qlen = 0;
while (1) {

24
src/teliva.h Normal file
View File

@ -0,0 +1,24 @@
#ifndef __TELIVA_H__
#define __TELIVA_H__
enum KEY_ACTION {
KEY_NULL = 0,
CTRL_B = 2,
CTRL_C = 3,
CTRL_D = 4,
CTRL_E = 5,
CTRL_F = 6,
CTRL_G = 7,
CTRL_H = 8,
TAB = 9,
ENTER = 10,
CTRL_L = 12,
CTRL_Q = 17,
CTRL_R = 18,
CTRL_S = 19,
CTRL_U = 21,
CTRL_X = 24,
ESC = 27,
};
#endif