1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-06-30 08:26: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

@ -185,3 +185,11 @@ bool valid_nick(uint8_t *nick)
return true;
}
/* Moves cursor to the end of the line in given window */
void mv_curs_end(WINDOW *w, size_t len, int max_y, int max_x)
{
int end_y = (len / max_x) + (max_y - CURS_Y_OFFSET);
int end_x = len % max_x;
wmove(w, end_y, end_x);
}