aboutsummaryrefslogtreecommitdiff
path: root/vis.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-07-03 18:10:05 +0200
committerMarc André Tanner <mat@brain-dump.org>2015-07-03 18:10:05 +0200
commite939ddc25927a1b0f03f3a878acfc1ffe167ff3f (patch)
treec98f6644e480dacfbdcc3dbb8eac2aa25aac0d8f /vis.c
parent506be16743cc5a049b9dcc640f2da74955f1ce2f (diff)
downloadvis-e939ddc25927a1b0f03f3a878acfc1ffe167ff3f.tar.gz
vis-e939ddc25927a1b0f03f3a878acfc1ffe167ff3f.tar.xz
Add movements to next/previous character within same line
These movements always keep the cursor on the same line and do not move over newlines.
Diffstat (limited to 'vis.c')
-rw-r--r--vis.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/vis.c b/vis.c
index 6f1fb27..e0ba9e6 100644
--- a/vis.c
+++ b/vis.c
@@ -105,6 +105,8 @@ enum {
MOVE_COLUMN,
MOVE_CHAR_PREV,
MOVE_CHAR_NEXT,
+ MOVE_LINE_CHAR_PREV,
+ MOVE_LINE_CHAR_NEXT,
MOVE_WORD_START_NEXT,
MOVE_WORD_END_PREV,
MOVE_WORD_END_NEXT,
@@ -186,6 +188,8 @@ static Movement moves[] = {
[MOVE_COLUMN] = { .txt = column, .type = CHARWISE|IDEMPOTENT},
[MOVE_CHAR_PREV] = { .txt = text_char_prev },
[MOVE_CHAR_NEXT] = { .txt = text_char_next },
+ [MOVE_LINE_CHAR_PREV] = { .txt = text_line_char_prev, .type = CHARWISE },
+ [MOVE_LINE_CHAR_NEXT] = { .txt = text_line_char_next, .type = CHARWISE },
[MOVE_WORD_START_PREV] = { .txt = text_word_start_prev, .type = CHARWISE },
[MOVE_WORD_START_NEXT] = { .txt = text_word_start_next, .type = CHARWISE },
[MOVE_WORD_END_PREV] = { .txt = text_word_end_prev, .type = CHARWISE|INCLUSIVE },