From 164527b74aa6cd04bd50c36399bc14ab90073bcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sun, 5 Apr 2015 10:10:47 +0200 Subject: 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. --- window.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'window.c') 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; -- cgit v1.2.3