mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-31 10:26:21 +00:00
Adding irssi style Alt-Left/Right window navigation
This commit is contained in:
@@ -1289,6 +1289,8 @@ cons_navigation_help(void)
|
|||||||
cons_show("");
|
cons_show("");
|
||||||
cons_show("Alt-1 : This console window.");
|
cons_show("Alt-1 : This console window.");
|
||||||
cons_show("Alt-2..Alt-0 : Chat windows.");
|
cons_show("Alt-2..Alt-0 : Chat windows.");
|
||||||
|
cons_show("Alt-LEFT : Previous chat window");
|
||||||
|
cons_show("Alt-RIGHT : Next chat window");
|
||||||
cons_show("F1 : This console window.");
|
cons_show("F1 : This console window.");
|
||||||
cons_show("F2..F10 : Chat windows.");
|
cons_show("F2..F10 : Chat windows.");
|
||||||
cons_show("UP, DOWN : Navigate input history.");
|
cons_show("UP, DOWN : Navigate input history.");
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "profanity.h"
|
#include "profanity.h"
|
||||||
#include "ui/ui.h"
|
#include "ui/ui.h"
|
||||||
|
#include "ui/windows.h"
|
||||||
#include "xmpp/xmpp.h"
|
#include "xmpp/xmpp.h"
|
||||||
|
|
||||||
#define _inp_win_refresh() prefresh(inp_win, 0, pad_start, rows-1, 0, rows-1, cols-1)
|
#define _inp_win_refresh() prefresh(inp_win, 0, pad_start, rows-1, 0, rows-1, cols-1)
|
||||||
@@ -559,6 +560,8 @@ _handle_alt_key(char *input, int *size, int key)
|
|||||||
{
|
{
|
||||||
int end_del = getcurx(inp_win);
|
int end_del = getcurx(inp_win);
|
||||||
int start_del = end_del;
|
int start_del = end_del;
|
||||||
|
int current = wins_get_current_num();
|
||||||
|
int new;
|
||||||
|
|
||||||
switch (key)
|
switch (key)
|
||||||
{
|
{
|
||||||
@@ -592,6 +595,24 @@ _handle_alt_key(char *input, int *size, int key)
|
|||||||
case '0':
|
case '0':
|
||||||
ui_switch_win(0);
|
ui_switch_win(0);
|
||||||
break;
|
break;
|
||||||
|
case KEY_LEFT:
|
||||||
|
if (current == 0) {
|
||||||
|
new = 9;
|
||||||
|
} else {
|
||||||
|
new = current - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
ui_switch_win(new);
|
||||||
|
break;
|
||||||
|
case KEY_RIGHT:
|
||||||
|
if (current == 9) {
|
||||||
|
new = 0;
|
||||||
|
} else {
|
||||||
|
new = current + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
ui_switch_win(new);
|
||||||
|
break;
|
||||||
case 263:
|
case 263:
|
||||||
case 127:
|
case 127:
|
||||||
input[*size] = '\0';
|
input[*size] = '\0';
|
||||||
|
|||||||
Reference in New Issue
Block a user