aboutsummaryrefslogtreecommitdiff
path: root/view.h
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-05-21 00:19:35 +0200
committerMarc André Tanner <mat@brain-dump.org>2016-05-22 00:05:30 +0200
commitffcdfc2012a9cbc9a104a75e8e87bcf5fa5de2e1 (patch)
tree0089d3f4e51f3523bcacda33e1fefbcdad996953 /view.h
parent1d2005c82f19f2094ffb57394832754160b9bbc6 (diff)
downloadvis-ffcdfc2012a9cbc9a104a75e8e87bcf5fa5de2e1.tar.gz
vis-ffcdfc2012a9cbc9a104a75e8e87bcf5fa5de2e1.tar.xz
vis: move syntax highlighting to pure Lua code
Diffstat (limited to 'view.h')
-rw-r--r--view.h22
1 files changed, 10 insertions, 12 deletions
diff --git a/view.h b/view.h
index 1b2ea4e..ac036fb 100644
--- a/view.h
+++ b/view.h
@@ -3,19 +3,20 @@
#include <stddef.h>
#include <stdbool.h>
-#if CONFIG_LUA
-#include <lua.h>
-#else
-typedef struct lua_State lua_State;
-#endif
-#include "register.h"
-#include "text.h"
-#include "ui.h"
typedef struct View View;
typedef struct Cursor Cursor;
typedef struct Selection Selection;
+#include "text.h"
+#include "ui.h"
+#include "register.h"
+
+typedef struct {
+ void *data;
+ void (*highlight)(void *data);
+} ViewEvent;
+
typedef struct {
int width; /* display width i.e. number of columns occupied by this character */
size_t len; /* number of bytes the character displayed in this cell uses, for
@@ -40,7 +41,7 @@ struct Line { /* a line on the screen, *not* in the file */
Cell cells[]; /* win->width cells storing information about the displayed characters */
};
-View *view_new(Text*, lua_State*);
+View *view_new(Text*, ViewEvent*);
void view_ui(View*, UiWin*);
/* change associated text displayed in this window */
void view_reload(View*, Text*);
@@ -89,9 +90,6 @@ Filerange view_viewport_get(View*);
*/
bool view_viewport_up(View *view, int n);
bool view_viewport_down(View *view, int n);
-/* associate a set of syntax highlighting rules to this window. */
-bool view_syntax_set(View*, const char *name);
-const char *view_syntax_get(View*);
void view_options_set(View*, enum UiOption options);
enum UiOption view_options_get(View*);