diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-02-19 17:49:53 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-02-19 17:49:53 +0000 |
commit | c3859d1df1fbdb63b8aab15d10266e26c5e428eb (patch) | |
tree | 8e83d8986670137d3c6e4f54aa1f1dbb92533ae1 /mode-key.c | |
parent | 5a5e285be8caf98c7777a2afa717d04ac44c9f75 (diff) | |
download | rtmux-c3859d1df1fbdb63b8aab15d10266e26c5e428eb.tar.gz rtmux-c3859d1df1fbdb63b8aab15d10266e26c5e428eb.tar.bz2 rtmux-c3859d1df1fbdb63b8aab15d10266e26c5e428eb.zip |
Add copy-pipe mode command to copy selection and also pipe to a command.
Diffstat (limited to 'mode-key.c')
-rw-r--r-- | mode-key.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -99,6 +99,7 @@ const struct mode_key_cmdstr mode_key_cmdstr_copy[] = { { MODEKEYCOPY_BOTTOMLINE, "bottom-line" }, { MODEKEYCOPY_CANCEL, "cancel" }, { MODEKEYCOPY_CLEARSELECTION, "clear-selection" }, + { MODEKEYCOPY_COPYPIPE, "copy-pipe" }, { MODEKEYCOPY_COPYLINE, "copy-line" }, { MODEKEYCOPY_COPYENDOFLINE, "copy-end-of-line" }, { MODEKEYCOPY_COPYSELECTION, "copy-selection" }, @@ -513,6 +514,7 @@ mode_key_init_trees(void) mbind->key = ment->key; mbind->mode = ment->mode; mbind->cmd = ment->cmd; + mbind->arg = NULL; RB_INSERT(mode_key_tree, mtab->tree, mbind); } } @@ -526,7 +528,7 @@ mode_key_init(struct mode_key_data *mdata, struct mode_key_tree *mtree) } enum mode_key_cmd -mode_key_lookup(struct mode_key_data *mdata, int key) +mode_key_lookup(struct mode_key_data *mdata, int key, const char **arg) { struct mode_key_binding *mbind, mtmp; @@ -546,6 +548,8 @@ mode_key_lookup(struct mode_key_data *mdata, int key) mdata->mode = 1 - mdata->mode; /* FALLTHROUGH */ default: + if (arg != NULL) + *arg = mbind->arg; return (mbind->cmd); } } |