From b366f55f29af3775c055115572dd84873b1921e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Tue, 28 Jul 2015 12:10:22 +0200 Subject: vis: use multiple cursor/selection infrastructure This commits introduces the following keybindings, in normal mode: CTRL-N select word the cursor is currently over, switch to visual mode CTRL-P remove least recently added cursor ESC if a selection is active, clear it. Otherwise dispose all but the primary cursor. In visual mode: CTRL-N create new cursor and select next word matching current selection CTRL-X clear (skip) current selection, but select next matching word CTRL-P remove least recently added cursor --- view.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'view.h') diff --git a/view.h b/view.h index 4e750c0..d0e7070 100644 --- a/view.h +++ b/view.h @@ -117,7 +117,10 @@ void view_cursor_to(View*, size_t pos); Cursor *view_cursors_new(View*); /* get number of active cursors */ int view_cursors_count(View*); -/* dispose an existing cursor */ +/* dispose an existing cursor with its associated selection (if any), + * not applicaple for the last existing cursor */ +void view_cursors_dispose(Cursor*); +/* dispose an existing cursor, no matter what */ void view_cursors_free(Cursor*); /* only keep the main cursor, release all others together with their * selections (if any) */ -- cgit v1.2.3