mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Use @current_tab for current tab.
This commit is contained in:
parent
3f94687e28
commit
0b58b99d30
@ -869,8 +869,8 @@ static void
|
|||||||
search_menu(struct menu *menu)
|
search_menu(struct menu *menu)
|
||||||
{
|
{
|
||||||
struct terminal *term = menu->win->term;
|
struct terminal *term = menu->win->term;
|
||||||
struct window *tab = get_current_tab(term);
|
struct window *current_tab = get_current_tab(term);
|
||||||
struct session *ses = tab ? tab->data : NULL;
|
struct session *ses = current_tab ? current_tab->data : NULL;
|
||||||
unsigned char *prompt = _("Search menu/", term);
|
unsigned char *prompt = _("Search menu/", term);
|
||||||
|
|
||||||
if (menu->size < 1 || !ses) return;
|
if (menu->size < 1 || !ses) return;
|
||||||
|
@ -221,9 +221,9 @@ get_master_session(void)
|
|||||||
|
|
||||||
foreach (ses, sessions)
|
foreach (ses, sessions)
|
||||||
if (ses->tab->term->master) {
|
if (ses->tab->term->master) {
|
||||||
struct window *tab = get_current_tab(ses->tab->term);
|
struct window *current_tab = get_current_tab(ses->tab->term);
|
||||||
|
|
||||||
return tab ? tab->data : NULL;
|
return current_tab ? current_tab->data : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -211,11 +211,11 @@ static void
|
|||||||
really_close_tabs(struct session *ses)
|
really_close_tabs(struct session *ses)
|
||||||
{
|
{
|
||||||
struct terminal *term = ses->tab->term;
|
struct terminal *term = ses->tab->term;
|
||||||
struct window *current = get_current_tab(term);
|
struct window *current_tab = get_current_tab(term);
|
||||||
struct window *tab;
|
struct window *tab;
|
||||||
|
|
||||||
foreach_tab (tab, term->windows) {
|
foreach_tab (tab, term->windows) {
|
||||||
if (tab == current) continue;
|
if (tab == current_tab) continue;
|
||||||
|
|
||||||
/* Update the current tab counter so assertions in the
|
/* Update the current tab counter so assertions in the
|
||||||
* delete_window() call-chain will hold, namely the one in
|
* delete_window() call-chain will hold, namely the one in
|
||||||
|
@ -1055,15 +1055,15 @@ send_mouse_event(struct session *ses, struct document_view *doc_view,
|
|||||||
/* Handle tabs navigation if tabs bar is displayed. */
|
/* Handle tabs navigation if tabs bar is displayed. */
|
||||||
if (ses->status.show_tabs_bar && is_mouse_on_tab_bar(ses, mouse)) {
|
if (ses->status.show_tabs_bar && is_mouse_on_tab_bar(ses, mouse)) {
|
||||||
int tab_num = get_tab_number_by_xpos(term, mouse->x);
|
int tab_num = get_tab_number_by_xpos(term, mouse->x);
|
||||||
struct window *tab = get_current_tab(term);
|
struct window *current_tab = get_current_tab(term);
|
||||||
|
|
||||||
if (check_mouse_action(ev, B_UP)) {
|
if (check_mouse_action(ev, B_UP)) {
|
||||||
if (check_mouse_button(ev, B_MIDDLE)
|
if (check_mouse_button(ev, B_MIDDLE)
|
||||||
&& term->current_tab == tab_num
|
&& term->current_tab == tab_num
|
||||||
&& mouse->y == term->prev_mouse_event.y) {
|
&& mouse->y == term->prev_mouse_event.y) {
|
||||||
if (tab->data == ses) ses = NULL;
|
if (current_tab->data == ses) ses = NULL;
|
||||||
|
|
||||||
close_tab(term, tab->data);
|
close_tab(term, current_tab->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ses;
|
return ses;
|
||||||
@ -1081,7 +1081,7 @@ send_mouse_event(struct session *ses, struct document_view *doc_view,
|
|||||||
if (check_mouse_button(ev, B_MIDDLE)) {
|
if (check_mouse_button(ev, B_MIDDLE)) {
|
||||||
do_not_ignore_next_mouse_event(term);
|
do_not_ignore_next_mouse_event(term);
|
||||||
} else if (check_mouse_button(ev, B_RIGHT)) {
|
} else if (check_mouse_button(ev, B_RIGHT)) {
|
||||||
tab_menu(tab->data, mouse->x, mouse->y, 1);
|
tab_menu(current_tab->data, mouse->x, mouse->y, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user