diff options
| -rw-r--r-- | editor.c | 4 | ||||
| -rw-r--r-- | text.c | 12 | ||||
| -rw-r--r-- | text.h | 10 | ||||
| -rw-r--r-- | vis.c | 16 | ||||
| -rw-r--r-- | window.c | 4 |
5 files changed, 23 insertions, 23 deletions
@@ -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); } @@ -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) { @@ -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*); @@ -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: @@ -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; } |
