mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-30 02:53:27 +01:00
small improvement
This commit is contained in:
parent
629041d465
commit
ff30a29df1
@ -170,6 +170,10 @@ static void prompt_onKey(ToxWindow *self, Tox *m, wint_t key)
|
||||
wmove(self->window, prt->orig_y, X_OFST);
|
||||
fetch_hist_item(prt->line, &prt->pos, &prt->len, prt->ln_history, prt->hst_tot,
|
||||
&prt->hst_pos, LN_HIST_MV_UP);
|
||||
if (prt->at_bottom && prt->len >= x2 - X_OFST) {
|
||||
--prt->orig_y;
|
||||
prt->scroll = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -116,11 +116,16 @@ void fetch_hist_item(wchar_t *buf, size_t *pos, size_t *len, wchar_t (*hst)[MAX_
|
||||
int hst_tot, int *hst_pos, int key_dir)
|
||||
{
|
||||
if (key_dir == LN_HIST_MV_UP) {
|
||||
if (--(*hst_pos) < 0)
|
||||
if (--(*hst_pos) < 0) {
|
||||
++(*hst_pos);
|
||||
beep();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (++(*hst_pos) == hst_tot)
|
||||
--(*hst_pos);
|
||||
if (++(*hst_pos) == hst_tot) {
|
||||
discard_buf(buf, pos, len);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const wchar_t *hst_line = hst[*hst_pos];
|
||||
|
Loading…
Reference in New Issue
Block a user