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. --- config.def.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'config.def.h') diff --git a/config.def.h b/config.def.h index b8657a4..48feb08 100644 --- a/config.def.h +++ b/config.def.h @@ -457,7 +457,7 @@ static KeyBinding vis_mode_visual_line[] = { static void vis_mode_visual_line_enter(Mode *old) { Win *win = vis->win->win; - window_cursor_to(win, text_line_begin(vis->win->text, window_cursor_get(win))); + window_cursor_to(win, text_line_begin(vis->win->text->data, window_cursor_get(win))); if (!old->visual) { window_selection_start(vis->win->win); vis_modes[VIS_MODE_OPERATOR].parent = &vis_modes[VIS_MODE_TEXTOBJ]; @@ -559,11 +559,11 @@ static KeyBinding vis_mode_insert[] = { static void vis_mode_insert_leave(Mode *old) { /* make sure we can recover the current state after an editing operation */ - text_snapshot(vis->win->text); + text_snapshot(vis->win->text->data); } static void vis_mode_insert_idle(void) { - text_snapshot(vis->win->text); + text_snapshot(vis->win->text->data); } static void vis_mode_insert_input(const char *str, size_t len) { @@ -585,7 +585,7 @@ static KeyBinding vis_mode_replace[] = { static void vis_mode_replace_leave(Mode *old) { /* make sure we can recover the current state after an editing operation */ - text_snapshot(vis->win->text); + text_snapshot(vis->win->text->data); } static void vis_mode_replace_input(const char *str, size_t len) { -- cgit v1.2.3