diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-07-10 18:14:40 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-07-10 18:26:05 +0200 |
| commit | c37fd32f2023a5d52b38b769e3d48d1f435fe2fd (patch) | |
| tree | 554bf0439b9db12226810e0c11f33dcd81661962 | |
| parent | f9e2b884c15919757651db8b10c033a344a19e75 (diff) | |
| download | vis-c37fd32f2023a5d52b38b769e3d48d1f435fe2fd.tar.gz vis-c37fd32f2023a5d52b38b769e3d48d1f435fe2fd.tar.xz | |
vis: remove change list
This was completely broken since 71eab6d5d72145f17ab3d4c87945ac12176ae8e9
and even before never really worked as one would expect.
If anything it should be implemented like the jump list using marks.
| -rw-r--r-- | config.def.h | 2 | ||||
| -rw-r--r-- | main.c | 12 | ||||
| -rw-r--r-- | vis-core.h | 7 | ||||
| -rw-r--r-- | vis-motions.c | 42 |
4 files changed, 0 insertions, 63 deletions
diff --git a/config.def.h b/config.def.h index b210ef3..39a3d33 100644 --- a/config.def.h +++ b/config.def.h @@ -241,8 +241,6 @@ static const KeyBinding bindings_normal[] = { { "<F1>", ALIAS(":help<Enter>") }, { "ga", ACTION(UNICODE_INFO) }, { "g8", ACTION(UTF8_INFO) }, - { "g,", ACTION(CHANGELIST_NEXT) }, - { "g;", ACTION(CHANGELIST_PREV) }, { "g-", ACTION(EARLIER) }, { "g+", ACTION(LATER) }, { "gn", ALIAS("vgn") }, @@ -215,8 +215,6 @@ enum { VIS_ACTION_JUMPLIST_PREV, VIS_ACTION_JUMPLIST_NEXT, VIS_ACTION_JUMPLIST_SAVE, - VIS_ACTION_CHANGELIST_PREV, - VIS_ACTION_CHANGELIST_NEXT, VIS_ACTION_UNDO, VIS_ACTION_REDO, VIS_ACTION_EARLIER, @@ -669,16 +667,6 @@ static const KeyAction vis_action[] = { VIS_HELP("Save current selections in jump list") jumplist, { .i = 0 } }, - [VIS_ACTION_CHANGELIST_PREV] = { - "vis-changelist-prev", - VIS_HELP("Go to older cursor position in change list") - movement, { .i = VIS_MOVE_CHANGELIST_PREV } - }, - [VIS_ACTION_CHANGELIST_NEXT] = { - "vis-changelist-next", - VIS_HELP("Go to newer cursor position in change list") - movement, { .i = VIS_MOVE_CHANGELIST_NEXT } - }, [VIS_ACTION_UNDO] = { "vis-undo", VIS_HELP("Undo last change") @@ -153,19 +153,12 @@ struct File { /* shared state among windows displaying the same file */ File *next, *prev; }; -typedef struct { - time_t state; /* state of the text, used to invalidate change list */ - size_t index; /* #number of changes */ - size_t pos; /* where the current change occured */ -} ChangeList; - struct Win { Vis *vis; /* editor instance to which this window belongs to */ UiWin *ui; /* ui object handling visual appearance of this window */ File *file; /* file being displayed in this window */ View *view; /* currently displayed part of underlying text */ MarkList jumplist; /* LRU jump management */ - ChangeList changelist; /* state for iterating through least recently changes */ Mode modes[VIS_MODE_INVALID]; /* overlay mods used for per window key bindings */ Win *parent; /* window which was active when showing the command prompt */ Mode *parent_mode; /* mode which was active when showing the command prompt */ diff --git a/vis-motions.c b/vis-motions.c index 6a668c5..5aa0e87 100644 --- a/vis-motions.c +++ b/vis-motions.c @@ -171,40 +171,6 @@ static size_t view_lines_bottom(Vis *vis, View *view) { return view_screenline_goto(vis->win->view, h - vis_count_get_default(vis, 0)); } -static size_t window_changelist_next(Vis *vis, Win *win, size_t pos) { - ChangeList *cl = &win->changelist; - Text *txt = win->file->text; - time_t state = text_state(txt); - if (cl->state != state) - cl->index = 0; - else if (cl->index > 0 && pos == cl->pos) - cl->index--; - size_t newpos = pos; - if (newpos == EPOS) - cl->index++; - else - cl->pos = newpos; - cl->state = state; - return cl->pos; -} - -static size_t window_changelist_prev(Vis *vis, Win *win, size_t pos) { - ChangeList *cl = &win->changelist; - Text *txt = win->file->text; - time_t state = text_state(txt); - if (cl->state != state) - cl->index = 0; - else if (pos == cl->pos) - win->changelist.index++; - size_t newpos = pos; - if (newpos == EPOS) - cl->index--; - else - cl->pos = newpos; - cl->state = state; - return cl->pos; -} - static size_t window_nop(Vis *vis, Win *win, size_t pos) { return pos; } @@ -586,14 +552,6 @@ const Movement vis_motions[] = { .view = view_lines_bottom, .type = LINEWISE|JUMP|IDEMPOTENT, }, - [VIS_MOVE_CHANGELIST_NEXT] = { - .win = window_changelist_next, - .type = INCLUSIVE, - }, - [VIS_MOVE_CHANGELIST_PREV] = { - .win = window_changelist_prev, - .type = INCLUSIVE, - }, [VIS_MOVE_NOP] = { .win = window_nop, .type = IDEMPOTENT, |
