The branch, master has been updated
via aa4920fea3dcdcaa0dbe4d373160195b1a3ca892 (commit)
via 5532766b1935a8888fb60fb9a238f0849b96050b (commit)
via 5dbf3cb036d8093599494b8c02407e8d2d079f0d (commit)
from ddf929390e2780f8e53536a7c0b2f974a3ce2721 (commit)
- Log -----------------------------------------------------------------
commit aa4920fea3dcdcaa0dbe4d373160195b1a3ca892
Author: Thomas <[email protected]>
Commit: Thomas Adam <[email protected]>
choose-tree: Reset top when toggling items
When choose-tree is told to expand/collapse items (especially when first
rendering collapsed to just show sessions), ensure that in addition to
setting the selected item, that the item itself appears on the bottom of the
screen, rather than off screen.
This was causing rendering glitches when a very small tmux window tried to
render a list of items in choose-tree much larger than itself, and the
selected item appeared off screen, and didn't show the selection until the
selection had wrapped around to the top of the screen.
---
cmd-choose-tree.c | 1 -
window-choose.c | 25 +++++++++++++++++--------
2 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/cmd-choose-tree.c b/cmd-choose-tree.c
index a9b6ffb..2fe6e17 100644
--- a/cmd-choose-tree.c
+++ b/cmd-choose-tree.c
@@ -228,7 +228,6 @@ windows_only:
free(final_win_template_last);
window_choose_ready(wl->window->active, cur_win, NULL);
- window_choose_collapse_all(wl->window->active);
if (args_has(args, 'u')) {
window_choose_expand_all(wl->window->active);
diff --git a/window-choose.c b/window-choose.c
index 5ed85f0..572581a 100644
--- a/window-choose.c
+++ b/window-choose.c
@@ -81,6 +81,7 @@ int window_choose_key_index(struct
window_choose_mode_data *, u_int);
int window_choose_index_key(struct window_choose_mode_data *, int);
void window_choose_prompt_input(enum window_choose_input_type,
const char *, struct window_pane *, int);
+void window_choose_reset_top(struct window_pane *, u_int);
void
window_choose_add(struct window_pane *wp, struct window_choose_data *wcd)
@@ -107,8 +108,17 @@ window_choose_set_current(struct window_pane *wp, u_int
cur)
struct screen *s = &data->screen;
data->selected = cur;
- if (data->selected > screen_size_y(s) - 1)
- data->top = ARRAY_LENGTH(&data->list) - screen_size_y(s);
+ window_choose_reset_top(wp, screen_size_y(s));
+}
+
+void
+window_choose_reset_top(struct window_pane *wp, u_int sy)
+{
+ struct window_choose_mode_data *data = wp->modedata;
+
+ data->top = 0;
+ if (data->selected > sy - 1)
+ data->top = data->selected - (sy - 1);
window_choose_redraw_screen(wp);
}
@@ -277,10 +287,7 @@ window_choose_resize(struct window_pane *wp, u_int sx,
u_int sy)
struct window_choose_mode_data *data = wp->modedata;
struct screen *s = &data->screen;
- data->top = 0;
- if (data->selected > sy - 1)
- data->top = data->selected - (sy - 1);
-
+ window_choose_reset_top(wp, sy);
screen_resize(s, sx, sy, 0);
window_choose_redraw_screen(wp);
}
@@ -373,6 +380,7 @@ window_choose_collapse_all(struct window_pane *wp)
{
struct window_choose_mode_data *data = wp->modedata;
struct window_choose_mode_item *item;
+ struct screen *scr = &data->screen;
struct session *s, *chosen;
u_int i;
@@ -391,7 +399,7 @@ window_choose_collapse_all(struct window_pane *wp)
if (item->wcd->type & TREE_SESSION)
data->selected = i;
}
- window_choose_redraw_screen(wp);
+ window_choose_reset_top(wp, screen_size_y(scr));
}
void
@@ -399,6 +407,7 @@ window_choose_expand_all(struct window_pane *wp)
{
struct window_choose_mode_data *data = wp->modedata;
struct window_choose_mode_item *item;
+ struct screen *scr = &data->screen;
struct session *s;
u_int i;
@@ -414,7 +423,7 @@ window_choose_expand_all(struct window_pane *wp)
}
}
- window_choose_redraw_screen(wp);
+ window_choose_reset_top(wp, screen_size_y(scr));
}
void
commit 5532766b1935a8888fb60fb9a238f0849b96050b
Author: Thomas Adam <[email protected]>
Commit: Thomas Adam <[email protected]>
Renumber windows: Lookup lastw via window not index
When calling 'movew -r' on a session to reorder the winlinks, ensure when
adding back in the information for the lastw stack that we look up the
winlink based on the window and not its index.
Using the index doesn't make sense here because when comparing it to the old
set, it will never match since the winlink has been renumbered.
Bug reported by Ben Boeckel.
---
session.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/session.c b/session.c
index 24e2e5e..bb742d8 100644
--- a/session.c
+++ b/session.c
@@ -615,7 +615,7 @@ session_renumber_windows(struct session *s)
memcpy(&old_lastw, &s->lastw, sizeof old_lastw);
TAILQ_INIT(&s->lastw);
TAILQ_FOREACH(wl, &old_lastw, sentry) {
- wl_new = winlink_find_by_index(&s->windows, wl->idx);
+ wl_new = winlink_find_by_window(&s->windows, wl->window);
if (wl_new != NULL)
TAILQ_INSERT_TAIL(&s->lastw, wl_new, sentry);
}
commit 5dbf3cb036d8093599494b8c02407e8d2d079f0d
Author: Thomas <[email protected]>
Commit: Thomas Adam <[email protected]>
Assign mouse x/y coords before checking them
When receiving mouse inputs, we should set the x/y coordinates earlier than
we currently do, so that we aren't off-by-one in the case when the statusbar
is at the top of the screen.
---
tty-keys.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tty-keys.c b/tty-keys.c
index d1c9d87..595ad6e 100644
--- a/tty-keys.c
+++ b/tty-keys.c
@@ -746,6 +746,8 @@ tty_keys_mouse(struct tty *tty, const char *buf, size_t
len, size_t *size)
m->sgr = sgr;
m->sgr_xb = sgr_b;
m->sgr_rel = sgr_rel;
+ m->x = x;
+ m->y = y;
if (b & 64) { /* wheel button */
b &= 3;
if (b == 0)
@@ -773,8 +775,6 @@ tty_keys_mouse(struct tty *tty, const char *buf, size_t
len, size_t *size)
}
m->button = (b & 3);
}
- m->x = x;
- m->y = y;
return (0);
}
-----------------------------------------------------------------------
Summary of changes:
cmd-choose-tree.c | 1 -
session.c | 2 +-
tty-keys.c | 4 ++--
window-choose.c | 25 +++++++++++++++++--------
4 files changed, 20 insertions(+), 12 deletions(-)
hooks/post-receive
--
tmux
------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and
AppDynamics. Performance Central is your source for news, insights,
analysis and resources for efficient Application Performance Management.
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
tmux-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-cvs