small tweaks (search engine, switch tab reload)

This commit is contained in:
WanderingPenwing 2024-08-03 23:57:30 +02:00
parent a4040a91ff
commit 64ffe66736

9
surf.c
View file

@ -404,7 +404,12 @@ void reload_tab(Client *c) {
}
void switch_tab(Client *c, const Arg *a) {
c->selected_tab = MIN(MAX(c->selected_tab + a->i, 0), g_list_length(c->tabs) - 1);
int new_selected_tab = MIN(MAX(c->selected_tab + a->i, 0), g_list_length(c->tabs) - 1);
if (c->selected_tab == new_selected_tab) {
return;
}
c->selected_tab = new_selected_tab;
update_tab_bar(c);
reload_tab(c);
}
@ -465,7 +470,7 @@ void new_tab(Client *c, const Arg *a) {
c->selected_tab = g_list_length(c->tabs) - 1;
update_tab_bar(c);
reload_tab(c);
Arg arg = SETPROP("_SURF_URI", "_SURF_GO", "PROMPT_GO");
Arg arg = SETPROP("_SURF_URI", "_SURF_GO", PROMPT_GO);
spawn(c, &arg);
}