From 979d51bcb65ccceec95f34a10fdf6446ac97473c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Thu, 11 Feb 2016 10:03:14 +0100 Subject: vis: add support for different kind of text objects Up until now text objects would only ever grow/expand if applied multiple times. The new SPLIT type allows text objects which cover a completely different range when applied with a count. --- vis-core.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'vis-core.h') diff --git a/vis-core.h b/vis-core.h index f78e8af..74b8940 100644 --- a/vis-core.h +++ b/vis-core.h @@ -70,10 +70,12 @@ typedef struct { /* Motion implementation, takes a cursor postion and returns a typedef struct { /* gets a cursor position and returns a file range (or text_range_empty()) * representing the text object containing the position. */ - Filerange (*range)(Text*, size_t pos); - enum { /* whether the object should include the delimiting symbols or not */ - INNER, - OUTER, + Filerange (*txt)(Text*, size_t pos); + Filerange (*vis)(Vis*, Text*, size_t pos); + enum { + INNER = 1 << 0, /* whether the object should include */ + OUTER = 1 << 1, /* the delimiting symbols or not */ + SPLIT = 1 << 2, /* whether multiple applications will yield a split range */ } type; } TextObject; -- cgit v1.2.3