aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-01-01 14:39:27 +0100
committerMarc André Tanner <mat@brain-dump.org>2015-01-01 14:39:27 +0100
commitb2dd2bb97a752f66d65c4e493e9ff7e778f883c4 (patch)
tree76b7e214bb8071d598c31a1ba51a57b548fd6b02
parent7154b8d77ea78396c44321a5e05614b0de02af22 (diff)
downloadvis-b2dd2bb97a752f66d65c4e493e9ff7e778f883c4.tar.gz
vis-b2dd2bb97a752f66d65c4e493e9ff7e778f883c4.tar.xz
Rename mark related functions
-rw-r--r--editor.c4
-rw-r--r--text.c12
-rw-r--r--text.h10
-rw-r--r--vis.c16
-rw-r--r--window.c4
5 files changed, 23 insertions, 23 deletions
diff --git a/editor.c b/editor.c
index b1e42a3..1a2a494 100644
--- a/editor.c
+++ b/editor.c
@@ -56,8 +56,8 @@ static void editor_window_cursor_moved(Win *winwin, void *data) {
EditorWin *win = data;
Filerange sel = window_selection_get(winwin);
if (text_range_valid(&sel) && sel.start != sel.end) {
- text_mark_set(win->text, MARK_SELECTION_START, sel.start);
- text_mark_set(win->text, MARK_SELECTION_END, sel.end);
+ text_mark_intern_set(win->text, MARK_SELECTION_START, sel.start);
+ text_mark_intern_set(win->text, MARK_SELECTION_END, sel.end);
}
editor_window_statusbar_draw(win);
}
diff --git a/text.c b/text.c
index e4da71d..47310f0 100644
--- a/text.c
+++ b/text.c
@@ -1145,7 +1145,7 @@ size_t text_lineno_by_pos(Text *txt, size_t pos) {
return cache->lineno;
}
-void text_mark_set(Text *txt, Mark mark, size_t pos) {
+void text_mark_intern_set(Text *txt, MarkIntern mark, size_t pos) {
if (mark < 0 || mark >= LENGTH(txt->marks))
return;
Location loc = piece_get_extern(txt, pos);
@@ -1154,7 +1154,7 @@ void text_mark_set(Text *txt, Mark mark, size_t pos) {
txt->marks[mark] = loc.piece->data + loc.off;
}
-size_t text_mark_get(Text *txt, Mark mark) {
+size_t text_mark_intern_get(Text *txt, MarkIntern mark) {
if (mark < 0 || mark >= LENGTH(txt->marks))
return EPOS;
const char *pos = txt->marks[mark];
@@ -1168,15 +1168,15 @@ size_t text_mark_get(Text *txt, Mark mark) {
return EPOS;
}
-void text_mark_clear(Text *txt, Mark mark) {
+void text_mark_intern_clear(Text *txt, MarkIntern mark) {
if (mark < 0 || mark >= LENGTH(txt->marks))
return;
txt->marks[mark] = NULL;
}
-void text_mark_clear_all(Text *txt) {
- for (Mark mark = 0; mark < LENGTH(txt->marks); mark++)
- text_mark_clear(txt, mark);
+void text_mark_intern_clear_all(Text *txt) {
+ for (MarkIntern mark = 0; mark < LENGTH(txt->marks); mark++)
+ text_mark_intern_clear(txt, mark);
}
int text_fd_get(Text *txt) {
diff --git a/text.h b/text.h
index 1a2035d..2a7d2de 100644
--- a/text.h
+++ b/text.h
@@ -75,11 +75,11 @@ bool text_iterator_byte_next(Iterator*, char *b);
bool text_iterator_char_next(Iterator*, char *c);
bool text_iterator_char_prev(Iterator*, char *c);
-typedef int Mark;
-void text_mark_set(Text*, Mark, size_t pos);
-size_t text_mark_get(Text*, Mark);
-void text_mark_clear(Text*, Mark);
-void text_mark_clear_all(Text*);
+typedef int MarkIntern;
+void text_mark_intern_set(Text*, MarkIntern, size_t pos);
+size_t text_mark_intern_get(Text*, MarkIntern);
+void text_mark_intern_clear(Text*, MarkIntern);
+void text_mark_intern_clear_all(Text*);
size_t text_size(Text*);
bool text_modified(Text*);
diff --git a/vis.c b/vis.c
index 873e48a..6d267ed 100644
--- a/vis.c
+++ b/vis.c
@@ -129,7 +129,7 @@ typedef struct { /** collects all information until an operator is e
Movement *movement;
TextObject *textobj;
Register *reg;
- Mark mark;
+ MarkIntern mark;
Key key;
Arg arg;
} Action;
@@ -717,11 +717,11 @@ static size_t search_backward(const Arg *arg) {
}
static void mark_set(const Arg *arg) {
- text_mark_set(vis->win->text, arg->i, window_cursor_get(vis->win->win));
+ text_mark_intern_set(vis->win->text, arg->i, window_cursor_get(vis->win->win));
}
static size_t mark_goto(const Arg *arg) {
- return text_mark_get(vis->win->text, action.mark);
+ return text_mark_intern_get(vis->win->text, action.mark);
}
static size_t mark_line_goto(const Arg *arg) {
@@ -1494,11 +1494,11 @@ static Filepos parse_pos(char **cmd) {
case '\'':
(*cmd)++;
if ('a' <= **cmd && **cmd <= 'z')
- pos = text_mark_get(txt, **cmd - 'a');
+ pos = text_mark_intern_get(txt, **cmd - 'a');
else if (**cmd == '<')
- pos = text_mark_get(txt, MARK_SELECTION_START);
+ pos = text_mark_intern_get(txt, MARK_SELECTION_START);
else if (**cmd == '>')
- pos = text_mark_get(txt, MARK_SELECTION_END);
+ pos = text_mark_intern_get(txt, MARK_SELECTION_END);
(*cmd)++;
break;
case '/':
@@ -1534,8 +1534,8 @@ static Filerange parse_range(char **cmd) {
(*cmd)++;
break;
case '*':
- r.start = text_mark_get(txt, MARK_SELECTION_START);
- r.end = text_mark_get(txt, MARK_SELECTION_END);
+ r.start = text_mark_intern_get(txt, MARK_SELECTION_START);
+ r.end = text_mark_intern_get(txt, MARK_SELECTION_END);
(*cmd)++;
break;
default:
diff --git a/window.c b/window.c
index bddcb3d..48044c5 100644
--- a/window.c
+++ b/window.c
@@ -175,8 +175,8 @@ Filerange window_selection_get(Win *win) {
if (!text_range_valid(&sel))
return text_range_empty();
sel.end = text_char_next(win->text, sel.end);
- text_mark_set(win->text, MARK_SELECTION_START, sel.start);
- text_mark_set(win->text, MARK_SELECTION_END, sel.end);
+ text_mark_intern_set(win->text, MARK_SELECTION_START, sel.start);
+ text_mark_intern_set(win->text, MARK_SELECTION_END, sel.end);
return sel;
}