1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-04 20:36:45 +02:00

add line history with up/down keys

This commit is contained in:
Jfreegman
2013-12-11 00:10:09 -05:00
parent ccc0640dab
commit 9a5a598c5a
8 changed files with 148 additions and 5 deletions

View File

@ -110,11 +110,18 @@ struct StatusBar {
bool is_online;
};
#define MAX_LINE_HIST 64
/* chat and groupchat window/buffer holder */
struct ChatContext {
wchar_t line[MAX_STR_SIZE];
size_t pos;
size_t len;
wchar_t ln_history[MAX_LINE_HIST][MAX_STR_SIZE];
int hst_pos;
int hst_tot;
WINDOW *history;
WINDOW *linewin;
WINDOW *sidebar;
@ -128,6 +135,11 @@ struct PromptBuf {
bool at_bottom; /* true if line end is at bottom of window */
int orig_y; /* y axis point of line origin */
bool scroll; /* used for prompt window hack to determine when to scroll down */
wchar_t ln_history[MAX_LINE_HIST][MAX_STR_SIZE];
int hst_pos;
int hst_tot;
WINDOW *linewin;
};