summaryrefslogtreecommitdiff
path: root/src/commands.c
diff options
context:
space:
mode:
authorportix <none@none>2012-11-30 18:36:01 +0100
committerportix <none@none>2012-11-30 18:36:01 +0100
commitd1bed65f0559f4f2735942ad152803f21c7e90d5 (patch)
treea8f2e6c6e5acf7217401c10f1525bc0d678a9892 /src/commands.c
parent342835d1eea41964ca40c34711af9f2c171d5e91 (diff)
downloaddwb-d1bed65f0559f4f2735942ad152803f21c7e90d5.zip
Implementing tab_next/prev, untested
Diffstat (limited to 'src/commands.c')
-rw-r--r--src/commands.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/src/commands.c b/src/commands.c
index 45940b2a..abc7d81c 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -30,6 +30,7 @@
#include "download.h"
#include "js.h"
#include "scripts.h"
+#include "tabs.h"
inline static int
dwb_floor(double x) {
@@ -894,6 +895,7 @@ commands_group_show(KeyMap *km, Arg *arg) {
}
return STATUS_OK;
}
+#endif
DwbStatus
commands_group_toggle(KeyMap *km, Arg *arg) {
int n = MIN(NUMMOD, 9), i=0;
@@ -907,19 +909,23 @@ commands_group_toggle(KeyMap *km, Arg *arg) {
DwbStatus
commands_group_tag(KeyMap *km, Arg *arg) {
int n = MIN(NUMMOD, 9);
- if (CURRENT_VIEW()->status->group & (1<<n)) {
- CURRENT_VIEW()->status->group &= ~(1<<n);
- if (!GROUP_VISIBLE(dwb.state.fview))
- dwb_hide_tab(dwb.state.fview);
- dwb_set_normal_message(dwb.state.fview, true, "Untagged group %d", n);
- }
- else {
- CURRENT_VIEW()->status->group |= 1<<n;
- if (GROUP_VISIBLE(dwb.state.fview))
- dwb_show_tab(dwb.state.fview);
- dwb_set_normal_message(dwb.state.fview, true, "Tagged group %d", n);
- }
+ if (dwb.state.nummod > 9 || dwb.state.nummod < 0)
+ return STATUS_ERROR;
+ CURRENT_VIEW()->status->group &= (1<<n);
+ tab_update(dwb.state.fview);
+
+ //if (CURRENT_VIEW()->status->group & (1<<n)) {
+ // CURRENT_VIEW()->status->group &= ~(1<<n);
+ // if (!GROUP_VISIBLE(dwb.state.fview))
+ // dwb_hide_tab(dwb.state.fview);
+ // dwb_set_normal_message(dwb.state.fview, true, "Untagged group %d", n);
+ //}
+ //else {
+ // CURRENT_VIEW()->status->group |= 1<<n;
+ // if (GROUP_VISIBLE(dwb.state.fview))
+ // dwb_show_tab(dwb.state.fview);
+ // dwb_set_normal_message(dwb.state.fview, true, "Tagged group %d", n);
+ //}
return STATUS_OK;
}
-#endif