aboutsummaryrefslogtreecommitdiff
path: root/window.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 /window.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 'window.c')
-rw-r--r--window.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/window.c b/window.c
index 888389a..10f7819 100644
--- a/window.c
+++ b/window.c
@@ -115,8 +115,9 @@ 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_intern_set(win->text, MARK_SELECTION_START, sel.start);
- text_mark_intern_set(win->text, MARK_SELECTION_END, sel.end);
+ // TODO
+ //text_mark_intern_set(win->text, MARK_SELECTION_START, sel.start);
+ //text_mark_intern_set(win->text, MARK_SELECTION_END, sel.end);
return sel;
}
@@ -439,7 +440,7 @@ void window_draw(Win *win) {
bool window_resize(Win *win, int width, int height) {
size_t lines_size = height*(sizeof(Line) + width*sizeof(Cell));
if (lines_size > win->lines_size) {
- Line *lines = malloc(lines_size);
+ Line *lines = realloc(win->lines, lines_size);
if (!lines)
return false;
win->lines = lines;