From 2deb344c3122e91a745734ce77b3e0967f169c2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 3 Sep 2014 21:35:16 +0200 Subject: Rudimentary support for copy / paste via registers --- vis.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'vis.h') diff --git a/vis.h b/vis.h index ea77a65..9c88c4e 100644 --- a/vis.h +++ b/vis.h @@ -22,11 +22,22 @@ struct VisWin { typedef void (*vis_statusbar_t)(WINDOW *win, bool active, const char *filename, size_t line, size_t col); +enum Reg { + REG_a, + REG_b, + REG_c, + // ... + REG_z, + REG_DEFAULT, + REG_LAST, +}; + struct Vis { int width, height; /* terminal size, available for all windows */ VisWin *windows; /* list of windows */ VisWin *win; /* currently active window */ Syntax *syntaxes; /* NULL terminated array of syntax definitions */ + Register registers[REG_LAST]; void (*windows_arrange)(Vis*); /* current layout which places the windows */ vis_statusbar_t statusbar; /* configurable user hook to draw statusbar */ }; @@ -74,7 +85,10 @@ typedef struct { size_t pos; } OperatorContext; -typedef void (Operator)(OperatorContext*); +typedef struct { + void (*func)(OperatorContext*); /* function implementing the operator logic */ + bool selfcontained; /* is this operator followed by movements/text-objects */ +} Operator; typedef struct { size_t (*win)(Win*); -- cgit v1.2.3