vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit cd99b93d4834ddf968008c23f1a210a11989fd52
parent 55c011b257dfe9fcdec5e7fced61cf0d4bfcec71
Author: Marc André Tanner <mat@brain-dump.org>
Date: Sat, 28 Nov 2015 19:33:14 +0100
vis: add namespace prefix for MARK_SELECTION_{START,END}
Diffstat:
| M | main.c | | | 4 | ++-- |
| M | vis-cmds.c | | | 8 | ++++---- |
| M | vis-modes.c | | | 8 | ++++---- |
| M | vis.h | | | 4 | ++-- |
4 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/main.c b/main.c @@ -1326,9 +1326,9 @@ static const char *key2mark(Vis *vis, const char *keys, int *mark) { if (keys[0] >= 'a' && keys[0] <= 'z') *mark = keys[0] - 'a'; else if (keys[0] == '<') - *mark = MARK_SELECTION_START; + *mark = VIS_MARK_SELECTION_START; else if (keys[0] == '>') - *mark = MARK_SELECTION_END; + *mark = VIS_MARK_SELECTION_END; return keys+1; } diff --git a/vis-cmds.c b/vis-cmds.c @@ -925,9 +925,9 @@ static Filepos parse_pos(Win *win, char **cmd) { if ('a' <= **cmd && **cmd <= 'z') pos = text_mark_get(txt, marks[**cmd - 'a']); else if (**cmd == '<') - pos = text_mark_get(txt, marks[MARK_SELECTION_START]); + pos = text_mark_get(txt, marks[VIS_MARK_SELECTION_START]); else if (**cmd == '>') - pos = text_mark_get(txt, marks[MARK_SELECTION_END]); + pos = text_mark_get(txt, marks[VIS_MARK_SELECTION_END]); (*cmd)++; break; case '/': @@ -976,8 +976,8 @@ static Filerange parse_range(Win *win, char **cmd) { (*cmd)++; break; case '*': - r.start = text_mark_get(txt, marks[MARK_SELECTION_START]); - r.end = text_mark_get(txt, marks[MARK_SELECTION_END]); + r.start = text_mark_get(txt, marks[VIS_MARK_SELECTION_START]); + r.end = text_mark_get(txt, marks[VIS_MARK_SELECTION_END]); (*cmd)++; break; default: diff --git a/vis-modes.c b/vis-modes.c @@ -88,8 +88,8 @@ static void vis_mode_visual_line_leave(Vis *vis, Mode *new) { vis_modes[VIS_MODE_OPERATOR].parent = &vis_modes[VIS_MODE_MOVE]; File *file = vis->win->file; Filerange sel = view_cursors_selection_get(view_cursors(vis->win->view)); - file->marks[MARK_SELECTION_START] = text_mark_set(file->text, sel.start); - file->marks[MARK_SELECTION_END] = text_mark_set(file->text, sel.end); + file->marks[VIS_MARK_SELECTION_START] = text_mark_set(file->text, sel.start); + file->marks[VIS_MARK_SELECTION_END] = text_mark_set(file->text, sel.end); if (new != &vis_modes[VIS_MODE_PROMPT]) view_selections_clear(vis->win->view); } else { @@ -102,8 +102,8 @@ static void vis_mode_visual_leave(Vis *vis, Mode *new) { vis_modes[VIS_MODE_OPERATOR].parent = &vis_modes[VIS_MODE_MOVE]; File *file = vis->win->file; Filerange sel = view_cursors_selection_get(view_cursors(vis->win->view)); - file->marks[MARK_SELECTION_START] = text_mark_set(file->text, sel.start); - file->marks[MARK_SELECTION_END] = text_mark_set(file->text, sel.end); + file->marks[VIS_MARK_SELECTION_START] = text_mark_set(file->text, sel.start); + file->marks[VIS_MARK_SELECTION_END] = text_mark_set(file->text, sel.end); if (new != &vis_modes[VIS_MODE_PROMPT]) view_selections_clear(vis->win->view); } diff --git a/vis.h b/vis.h @@ -331,8 +331,8 @@ enum VisMark { VIS_MARK_p, VIS_MARK_q, VIS_MARK_r, VIS_MARK_s, VIS_MARK_t, VIS_MARK_u, VIS_MARK_v, VIS_MARK_w, VIS_MARK_x, VIS_MARK_y, VIS_MARK_z, - MARK_SELECTION_START, /* '< */ - MARK_SELECTION_END, /* '> */ + VIS_MARK_SELECTION_START, /* '< */ + VIS_MARK_SELECTION_END, /* '> */ VIS_MARK_INVALID, /* has to be the last enum member */ };