List windows with /window
Reuse the /window command to preserve /wi abbreviation.weechat-hashes
parent
1deee3c81b
commit
f559322224
|
@ -1,4 +1,4 @@
|
|||
.Dd May 27, 2021
|
||||
.Dd May 28, 2021
|
||||
.Dt CATGIRL 1
|
||||
.Os
|
||||
.
|
||||
|
@ -517,6 +517,8 @@ or matching
|
|||
Temporarily remove a message highlight pattern.
|
||||
.It Ic /unignore Ar pattern
|
||||
Temporarily remove a message ignore pattern.
|
||||
.It Ic /window
|
||||
List all windows.
|
||||
.It Ic /window Ar name
|
||||
Switch to window by name.
|
||||
.It Ic /window Ar num | Ic / Ns Ar num
|
||||
|
|
1
chat.h
1
chat.h
|
@ -302,6 +302,7 @@ void uiInitLate(void);
|
|||
void uiShow(void);
|
||||
void uiHide(void);
|
||||
void uiDraw(void);
|
||||
void uiWindows(void);
|
||||
void uiShowID(uint id);
|
||||
void uiShowNum(uint num);
|
||||
void uiMoveID(uint id, uint num);
|
||||
|
|
|
@ -373,8 +373,9 @@ static void commandQuery(uint id, char *params) {
|
|||
}
|
||||
|
||||
static void commandWindow(uint id, char *params) {
|
||||
if (!params) return;
|
||||
if (isdigit(params[0])) {
|
||||
if (!params) {
|
||||
uiWindows();
|
||||
} else if (isdigit(params[0])) {
|
||||
uiShowNum(strtoul(params, NULL, 10));
|
||||
} else {
|
||||
id = idFind(params);
|
||||
|
|
10
ui.c
10
ui.c
|
@ -797,6 +797,16 @@ static void inputUpdate(void) {
|
|||
wmove(input, y, x);
|
||||
}
|
||||
|
||||
void uiWindows(void) {
|
||||
for (uint num = 0; num < windows.len; ++num) {
|
||||
const struct Window *window = windows.ptrs[num];
|
||||
uiFormat(
|
||||
Network, Warm, NULL, "\3%02d%u %s",
|
||||
idColors[window->id], num, idNames[window->id]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
static void windowShow(uint num) {
|
||||
if (num != windows.show) {
|
||||
windows.swap = windows.show;
|
||||
|
|
Loading…
Reference in New Issue