From 69345edd77b3ff98a99b36de8063f9e5febad3eb Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sat, 7 Jul 2012 00:53:09 +0200 Subject: Add support for copy/paste registers This adds support for vim-style copy/paste registers which allows cutting and copying multiple items without having to overwrite the copy/paste buffer. Registers can be specified using the quote key ('"'). To access a register, type '"x' before a command where "x" is the name of a register. If you want to copy the currently selected item into register 1, type '"1c'. Valid registers are 0-9, a-z, "-" and "_". Note that the latter is the so-called black hole register, which works similar to the black hole register in vim. The register prefix key is currently hardcoded and cannot be configured. Signed-off-by: Lukas Fleischer --- src/calcurse.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/calcurse.h') diff --git a/src/calcurse.h b/src/calcurse.h index 8674321..c9b0307 100644 --- a/src/calcurse.h +++ b/src/calcurse.h @@ -160,6 +160,9 @@ #define KEYS_LABELEN 8 /* length of command description */ #define KEYS_CMDS_PER_LINE 6 /* max number of commands per line */ +/* Register definitions. */ +#define REG_BLACK_HOLE 37 + /* Size of the hash table the note garbage collector uses. */ #define NOTE_GC_HSIZE 1024 @@ -722,10 +725,10 @@ void interact_day_item_delete(unsigned *, unsigned *); void interact_day_item_edit(void); void interact_day_item_pipe(void); void interact_day_item_repeat(void); -void interact_day_item_cut_free(); -void interact_day_item_cut(unsigned *, unsigned *); -void interact_day_item_copy(unsigned *, unsigned *); -void interact_day_item_paste(unsigned *, unsigned *); +void interact_day_item_cut_free(unsigned); +void interact_day_item_cut(unsigned *, unsigned *, unsigned); +void interact_day_item_copy(unsigned *, unsigned *, unsigned); +void interact_day_item_paste(unsigned *, unsigned *, unsigned); void interact_todo_add(void); void interact_todo_delete(void); void interact_todo_edit(void); @@ -768,7 +771,7 @@ void keys_free(void); void keys_dump_defaults(char *); const char *keys_get_label(enum key); enum key keys_get_action(int); -enum key keys_getch(WINDOW * win, int *); +enum key keys_getch(WINDOW * win, int *, int *); int keys_assign_binding(int, enum key); void keys_remove_binding(int, enum key); int keys_str2int(const char *); -- cgit v1.2.3-54-g00ecf