diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2015-04-05 10:10:47 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2015-04-05 19:58:45 +0200 |
| commit | 164527b74aa6cd04bd50c36399bc14ab90073bcf (patch) | |
| tree | 53d61af1dc32bb5bfaaa94d06c02bfd521df2de8 /window.c | |
| parent | 1304c0680b8db9d8526eb36f0b563d534703338b (diff) | |
| download | vis-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.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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; |
