From d7a7a3efde175e944cc6943170c9f60467850060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Thu, 23 Jul 2015 14:38:45 +0200 Subject: vis: add infrastructure to support multiple cursors/selections This cleans up the existing selection handling code and adds the necessary bits to eventually support multiple cursors/selections. The cursor position is kept track of using marks, which means retrieving the cursor position is no longer a constant time operation. Furthermore the terminal cursor is no longer used, instead the whole window is redrawn after every cursor movement. --- editor.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'editor.h') diff --git a/editor.h b/editor.h index fb57469..7f05b12 100644 --- a/editor.h +++ b/editor.h @@ -75,7 +75,7 @@ typedef struct { typedef struct { size_t (*cmd)(const Arg*); /* a custom movement based on user input from vis.c */ - size_t (*view)(View*); /* a movement based on current window content from view.h */ + size_t (*view)(Cursor*); /* a movement based on current window content from view.h */ size_t (*txt)(Text*, size_t pos); /* a movement form text-motions.h */ size_t (*file)(File*, size_t pos); enum { @@ -260,7 +260,6 @@ void editor_suspend(Editor*); * that all windows which show the affected region are redrawn too. */ void editor_insert_key(Editor*, const char *data, size_t len); void editor_replace_key(Editor*, const char *data, size_t len); -void editor_backspace_key(Editor*); void editor_insert(Editor*, size_t pos, const char *data, size_t len); void editor_delete(Editor*, size_t pos, size_t len); void editor_replace(Editor*, size_t pos, const char *data, size_t len); -- cgit v1.2.3