From 76d6d3641f271be1756e41494960d96714e7ee58 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 11 Oct 2016 07:23:34 +0000 Subject: Fundamental change to how copy mode key bindings work: The vi-copy and emacs-copy mode key tables are gone, and instead copy mode commands are bound in one of two normal key tables ("copy-mode" or "copy-mode-vi"). Keys are bound to "send-keys -X copy-mode-command". So: bind -temacs-copy C-Up scroll-up bind -temacs-copy -R5 WheelUpPane scroll-up Becomes: bind -Tcopy-mode C-Up send -X scroll-up bind -Tcopy-mode WheelUpPane send -N5 -X scroll-up This allows the full command parser and command set to be used - for example, we can use the normal command prompt for searching, jumping, and so on instead of a custom one: bind -Tcopy-mode C-r command-prompt -p'search up' "send -X search-backward '%%'" command-prompt also gets a -1 option to only require on key press, which is needed for jumping. The plan is to get rid of mode keys entirely, so more to come eventually. --- window.c | 1 + 1 file changed, 1 insertion(+) (limited to 'window.c') diff --git a/window.c b/window.c index 84b6cc5a..2dd8f78f 100644 --- a/window.c +++ b/window.c @@ -1124,6 +1124,7 @@ window_pane_reset_mode(struct window_pane *wp) wp->mode->free(wp); wp->mode = NULL; + wp->modeprefix = 1; wp->screen = &wp->base; wp->flags |= (PANE_REDRAW|PANE_CHANGED); -- cgit From e45401846f0a423bb90ebd3943041a28b2657631 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 11 Oct 2016 13:21:59 +0000 Subject: Add static in window-*.c and move some internal functions out of tmux.h. --- window.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'window.c') diff --git a/window.c b/window.c index 2dd8f78f..a2a53c06 100644 --- a/window.c +++ b/window.c @@ -60,15 +60,23 @@ static u_int next_window_pane_id; static u_int next_window_id; static u_int next_active_point; +static struct window_pane *window_pane_create(struct window *, u_int, u_int, + u_int); +static void window_pane_destroy(struct window_pane *); + static void window_pane_set_watermark(struct window_pane *, size_t); static void window_pane_read_callback(struct bufferevent *, void *); static void window_pane_error_callback(struct bufferevent *, short, void *); +static int winlink_next_index(struct winlinks *, int); + static struct window_pane *window_pane_choose_best(struct window_pane **, u_int); RB_GENERATE(windows, window, entry, window_cmp); +RB_GENERATE(winlinks, winlink, entry, winlink_cmp); +RB_GENERATE(window_pane_tree, window_pane, tree_entry, window_pane_cmp); int window_cmp(struct window *w1, struct window *w2) @@ -76,16 +84,12 @@ window_cmp(struct window *w1, struct window *w2) return (w1->id - w2->id); } -RB_GENERATE(winlinks, winlink, entry, winlink_cmp); - int winlink_cmp(struct winlink *wl1, struct winlink *wl2) { return (wl1->idx - wl2->idx); } -RB_GENERATE(window_pane_tree, window_pane, tree_entry, window_pane_cmp); - int window_pane_cmp(struct window_pane *wp1, struct window_pane *wp2) { @@ -129,7 +133,7 @@ winlink_find_by_window_id(struct winlinks *wwl, u_int id) return (NULL); } -int +static int winlink_next_index(struct winlinks *wwl, int idx) { int i; @@ -731,7 +735,7 @@ window_pane_find_by_id(u_int id) return (RB_FIND(window_pane_tree, &all_window_panes, &wp)); } -struct window_pane * +static struct window_pane * window_pane_create(struct window *w, u_int sx, u_int sy, u_int hlimit) { struct window_pane *wp; @@ -782,7 +786,7 @@ window_pane_create(struct window *w, u_int sx, u_int sy, u_int hlimit) return (wp); } -void +static void window_pane_destroy(struct window_pane *wp) { window_pane_reset_mode(wp); -- cgit