diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2015-10-25 21:04:25 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2015-10-25 22:46:43 +0100 |
| commit | 81bae7262b21b7f19bfaf0de4499a56372ef2a20 (patch) | |
| tree | 52b54f2b04c8e3328f61d7f6962182d819234264 /editor.c | |
| parent | 34fa064edcf06d03c16c8a20dde9365d9957523e (diff) | |
| download | vis-81bae7262b21b7f19bfaf0de4499a56372ef2a20.tar.gz vis-81bae7262b21b7f19bfaf0de4499a56372ef2a20.tar.xz | |
vis: convert jumplist navigation to proper motions
Diffstat (limited to 'editor.c')
| -rw-r--r-- | editor.c | 37 |
1 files changed, 0 insertions, 37 deletions
@@ -70,43 +70,6 @@ bool editor_window_split(Win *original) { return true; } -void editor_window_jumplist_add(Win *win, size_t pos) { - Mark mark = text_mark_set(win->file->text, pos); - if (mark && win->jumplist) - ringbuf_add(win->jumplist, mark); -} - -size_t editor_window_jumplist_prev(Win *win) { - size_t cur = view_cursor_get(win->view); - while (win->jumplist) { - Mark mark = ringbuf_prev(win->jumplist); - if (!mark) - return cur; - size_t pos = text_mark_get(win->file->text, mark); - if (pos != EPOS && pos != cur) - return pos; - } - return cur; -} - -size_t editor_window_jumplist_next(Win *win) { - size_t cur = view_cursor_get(win->view); - while (win->jumplist) { - Mark mark = ringbuf_next(win->jumplist); - if (!mark) - return cur; - size_t pos = text_mark_get(win->file->text, mark); - if (pos != EPOS && pos != cur) - return pos; - } - return cur; -} - -void editor_window_jumplist_invalidate(Win *win) { - if (win->jumplist) - ringbuf_invalidate(win->jumplist); -} - void editor_resize(Editor *ed) { ed->ui->resize(ed->ui); } |
