vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit f999d25b1cbb637c7e537003b887b3811bf0fbf0
parent 26adfa137b4cbeb39d6d8e03d22f6ecfe3b7f793
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Thu, 23 Feb 2017 08:03:08 +0100

vis-lua: use shorter type names

Diffstat:
Mlua/vis.lua | 2+-
Mvis-lua.c | 20++++++++++----------
2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/lua/vis.lua b/lua/vis.lua @@ -199,7 +199,7 @@ vis.events = events -- @tparam int the absolute position in bytes to test for a match -- @tparam[opt] int horizon the number of bytes around `pos` to consider (defaults to 1K) -- @treturn int start,end the range of the matched region or `nil` -vis.types['vis.file'].match_at = function(file, pattern, pos, horizon) +vis.types.file.match_at = function(file, pattern, pos, horizon) horizon = horizon or 1024 local lpeg = vis.lpeg if not lpeg then return nil end diff --git a/vis-lua.c b/vis-lua.c @@ -31,16 +31,16 @@ #endif #define VIS_LUA_TYPE_VIS "vis" -#define VIS_LUA_TYPE_FILE "vis.file" -#define VIS_LUA_TYPE_TEXT "vis.file.text" -#define VIS_LUA_TYPE_MARK "vis.file.mark" -#define VIS_LUA_TYPE_MARKS "vis.file.marks" -#define VIS_LUA_TYPE_WINDOW "vis.window" -#define VIS_LUA_TYPE_CURSOR "vis.window.cursor" -#define VIS_LUA_TYPE_CURSORS "vis.window.cursors" -#define VIS_LUA_TYPE_UI "vis.ui" -#define VIS_LUA_TYPE_REGISTERS "vis.registers" -#define VIS_LUA_TYPE_KEYACTION "vis.keyaction" +#define VIS_LUA_TYPE_FILE "file" +#define VIS_LUA_TYPE_TEXT "text" +#define VIS_LUA_TYPE_MARK "mark" +#define VIS_LUA_TYPE_MARKS "marks" +#define VIS_LUA_TYPE_WINDOW "window" +#define VIS_LUA_TYPE_CURSOR "cursor" +#define VIS_LUA_TYPE_CURSORS "cursors" +#define VIS_LUA_TYPE_UI "ui" +#define VIS_LUA_TYPE_REGISTERS "registers" +#define VIS_LUA_TYPE_KEYACTION "keyaction" #ifndef DEBUG_LUA #define DEBUG_LUA 0