mirror of
				https://github.com/Tha14/toxic.git
				synced 2025-11-01 13:16:52 +01:00 
			
		
		
		
	small improvement
This commit is contained in:
		| @@ -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]; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user