aboutsummaryrefslogtreecommitdiff
path: root/text.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-04-05 10:10:47 +0200
committerMarc André Tanner <mat@brain-dump.org>2015-04-05 19:58:45 +0200
commit164527b74aa6cd04bd50c36399bc14ab90073bcf (patch)
tree53d61af1dc32bb5bfaaa94d06c02bfd521df2de8 /text.c
parent1304c0680b8db9d8526eb36f0b563d534703338b (diff)
downloadvis-164527b74aa6cd04bd50c36399bc14ab90073bcf.tar.gz
vis-164527b74aa6cd04bd50c36399bc14ab90073bcf.tar.xz
Introduce new struct VisText
This adds yet another layer of indirection and stores vi related stuff which is associated with a given text but shared among all windows displaying it (e.g. marks). This will also help if one wants to keep texts arround which aren't currently displayed.
Diffstat (limited to 'text.c')
-rw-r--r--text.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/text.c b/text.c
index cd85734..553a3cb 100644
--- a/text.c
+++ b/text.c
@@ -118,7 +118,6 @@ struct Text {
struct stat info; /* stat as proped on load time */
int fd; /* the file descriptor of the original mmap-ed data */
LineCache lines; /* mapping between absolute pos in bytes and logical line breaks */
- Mark marks[32]; /* a mark is a pointer into an underlying buffer */
int newlines; /* 0: unknown, 1: \n, -1: \r\n */
};
@@ -1159,29 +1158,6 @@ size_t text_mark_get(Text *txt, Mark mark) {
return EPOS;
}
-void text_mark_intern_set(Text *txt, MarkIntern mark, size_t pos) {
- if (mark < 0 || mark >= LENGTH(txt->marks))
- return;
- txt->marks[mark] = text_mark_set(txt, pos);
-}
-
-size_t text_mark_intern_get(Text *txt, MarkIntern mark) {
- if (mark < 0 || mark >= LENGTH(txt->marks))
- return EPOS;
- return text_mark_get(txt, txt->marks[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_intern_clear_all(Text *txt) {
- for (MarkIntern mark = 0; mark < LENGTH(txt->marks); mark++)
- text_mark_intern_clear(txt, mark);
-}
-
size_t text_history_get(Text *txt, size_t index) {
for (Action *a = txt->current_action ? txt->current_action : txt->undo; a; a = a->next) {
if (index-- == 0) {