From b1c462beb8b9e0bae7f8886054eee2fe361149a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sat, 28 Nov 2015 18:45:07 +0100 Subject: view: remove ViewEvent infrastructure The only used event handler was used to update the '< and '> marks which is now taken care of by the leave handler of the visual modes. --- vis.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'vis.c') diff --git a/vis.c b/vis.c index c37dc28..f825862 100644 --- a/vis.c +++ b/vis.c @@ -158,14 +158,6 @@ static void windows_invalidate(Vis *vis, size_t start, size_t end) { view_draw(vis->win->view); } -static void window_selection_changed(void *win, Filerange *sel) { - File *file = ((Win*)win)->file; - if (text_range_valid(sel)) { - file->marks[MARK_SELECTION_START] = text_mark_set(file->text, sel->start); - file->marks[MARK_SELECTION_END] = text_mark_set(file->text, sel->end); - } -} - static void window_free(Win *win) { if (!win) return; @@ -183,12 +175,8 @@ static Win *window_new_file(Vis *vis, File *file) { return NULL; win->vis = vis; win->file = file; - win->events = (ViewEvent) { - .data = win, - .selection = window_selection_changed, - }; win->jumplist = ringbuf_alloc(31); - win->view = view_new(file->text, vis->lua, &win->events); + win->view = view_new(file->text, vis->lua); win->ui = vis->ui->window_new(vis->ui, win->view, file); if (!win->jumplist || !win->view || !win->ui) { window_free(win); @@ -382,7 +370,7 @@ Vis *vis_new(Ui *ui) { goto err; if (!(vis->prompt->file->text = text_load(NULL))) goto err; - if (!(vis->prompt->view = view_new(vis->prompt->file->text, NULL, NULL))) + if (!(vis->prompt->view = view_new(vis->prompt->file->text, NULL))) goto err; if (!(vis->prompt->ui = vis->ui->prompt_new(vis->ui, vis->prompt->view, vis->prompt->file))) goto err; -- cgit v1.2.3