commit aec9ca13ca6341919b2f2ea997dcdcf0a428f43b
parent f32df88b623ddad68e6d9d695115f45c760b38c0
Author: hhvn <dev@hhvn.uk>
Date: Mon, 23 May 2022 20:24:50 +0100
Don't show nicklist on /set if selected.hasnicks == 0
Diffstat:
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/config.c b/src/config.c
@@ -322,7 +322,8 @@ config_window_hide(struct Config *conf, long num) {
if (!num)
loc = config_getl("nicklist.location");
}
- windows[win].location = loc;
+ if (win != Win_nicklist || selected.hasnicks)
+ windows[win].location = loc;
conf->isdef = 0;
ui_redraw();
return 1;
@@ -332,7 +333,7 @@ config_window_hide(struct Config *conf, long num) {
static int
config_window_location(struct Config *conf, long num) {
struct Config *otherloc, *otherhide;
- enum WindowLocation win, otherwin;
+ enum Windows win, otherwin;
if (strcmp(conf->name, "buflist.location") == 0) {
win = Win_buflist;
otherwin = Win_nicklist;
@@ -347,10 +348,12 @@ config_window_location(struct Config *conf, long num) {
if (num == otherloc->num) {
otherloc->num = (num == Location_left) ? Location_right : Location_left;
otherloc->isdef = 0;
- if (!otherhide->num)
+ if (!otherhide->num && (otherwin != Win_nicklist || selected.hasnicks))
windows[otherwin].location = otherloc->num;
}
- conf->num = windows[win].location = num;
+ conf->num = num;
+ if (win != Win_nicklist || selected.hasnicks)
+ windows[win].location = num;
conf->isdef = 0;
ui_redraw();
return 0;