mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-23 01:53:02 +01:00
Add input line text to history on UP and DOWN
This commit is contained in:
parent
127f9462e0
commit
ddeca171a0
@ -236,6 +236,13 @@ void add_line_to_hist(ChatContext *ctx)
|
|||||||
resets line if at end of history */
|
resets line if at end of history */
|
||||||
void fetch_hist_item(ChatContext *ctx, int key_dir)
|
void fetch_hist_item(ChatContext *ctx, int key_dir)
|
||||||
{
|
{
|
||||||
|
if(wcscmp(ctx->line, L"\0") != 0
|
||||||
|
&& ctx->hst_pos == ctx->hst_tot)
|
||||||
|
{
|
||||||
|
add_line_to_hist(ctx);
|
||||||
|
ctx->hst_pos--;
|
||||||
|
}
|
||||||
|
|
||||||
if (key_dir == KEY_UP) {
|
if (key_dir == KEY_UP) {
|
||||||
if (--ctx->hst_pos < 0) {
|
if (--ctx->hst_pos < 0) {
|
||||||
ctx->hst_pos = 0;
|
ctx->hst_pos = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user