aboutsummaryrefslogtreecommitdiff
path: root/view.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-04-19 13:11:52 +0200
committerMarc André Tanner <mat@brain-dump.org>2017-04-19 13:42:25 +0200
commit2c8fcaa8fbb17b99aa5b0f8bfbbe0451dfa509f3 (patch)
tree1160dd96040c19f2a6da365e29240d978c6067ca /view.c
parenta2316394d35eb548545730cbf2b57b27e733214c (diff)
downloadvis-2c8fcaa8fbb17b99aa5b0f8bfbbe0451dfa509f3.tar.gz
vis-2c8fcaa8fbb17b99aa5b0f8bfbbe0451dfa509f3.tar.xz
vis: restructure register handling
Decouple register content from cursors. Previously each cursor had exactly one corresponding register. Now each register can save a list of values whose lifetime is not tied to the cursor. If multiple cursors exist and a put with a register holding only a single value is performed, then this value is inserted at every cursor location. If there are fewer values available than cursors, then only the matching ones will be used. If a register holding multiple values is inserted in a single cursor context, only the first value will be used. Another option would be to join all existing values. The details of this behavior might be changed in the future. <C-r> in insert mode has not yet been adapted and register handling in general needs to be cleaned up further. Fix #527
Diffstat (limited to 'view.c')
-rw-r--r--view.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/view.c b/view.c
index 7e893ff..76410aa 100644
--- a/view.c
+++ b/view.c
@@ -55,7 +55,6 @@ struct Cursor { /* cursor position */
Selection *sel; /* selection (if any) which folows the cursor upon movement */
Mark lastsel_anchor;/* previously used selection data, */
Mark lastsel_cursor;/* used to restore it */
- Register reg; /* per cursor register to support yank/put operation */
int generation; /* used to filter out newly created cursors during iteration */
int number; /* how many cursors are located before this one */
View *view; /* associated view to which this cursor belongs */
@@ -1005,7 +1004,6 @@ bool view_cursors_multiple(View *view) {
static void view_cursors_free(Cursor *c) {
if (!c)
return;
- register_release(&c->reg);
for (Cursor *after = c->next; after; after = after->next)
after->number--;
if (c->prev)
@@ -1119,10 +1117,6 @@ int view_cursors_cell_set(Cursor *c, int cell) {
return c->col;
}
-Register *view_cursors_register(Cursor *c) {
- return &c->reg;
-}
-
void view_cursors_scroll_to(Cursor *c, size_t pos) {
View *view = c->view;
if (view->cursor == c) {