aboutsummaryrefslogtreecommitdiff
path: root/view.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-07-27 21:04:20 +0200
committerMarc André Tanner <mat@brain-dump.org>2015-07-28 13:21:50 +0200
commit620518966fb99511c506af292cc1885f7a419881 (patch)
treea3ae882163f2837bd4b55a5a67dc46b0c6fbf731 /view.c
parentc9499ddd97d1bb8395e896050e92c6eee7e4b205 (diff)
downloadvis-620518966fb99511c506af292cc1885f7a419881.tar.gz
vis-620518966fb99511c506af292cc1885f7a419881.tar.xz
vis: add per cursor registers
Diffstat (limited to 'view.c')
-rw-r--r--view.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/view.c b/view.c
index 875635f..43915ce 100644
--- a/view.c
+++ b/view.c
@@ -41,6 +41,7 @@ struct Cursor { /* cursor position */
Line *line; /* screen line on which cursor currently resides */
Mark mark; /* mark used to keep track of current cursor position */
Selection *sel; /* selection (if any) which folows the cursor upon movement */
+ Register reg; /* per cursor register to support yank/put operation */
View *view; /* associated view to which this cursor belongs */
Cursor *prev, *next;/* previous/next cursors in no particular order */
};
@@ -892,6 +893,7 @@ Cursor *view_cursors_new(View *view) {
void view_cursors_free(Cursor *c) {
if (!c)
return;
+ register_release(&c->reg);
if (c->prev)
c->prev->next = c->next;
if (c->next)
@@ -923,6 +925,10 @@ size_t view_cursors_pos(Cursor *c) {
return text_mark_get(c->view->text, c->mark);
}
+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) {