merge with upstream

This commit is contained in:
Night Kaly 2024-03-12 21:01:11 +00:00
commit bf3cbe71d1
No known key found for this signature in database
GPG key ID: 8E829D3381CFEBBE

25
ccc.c
View file

@ -13,6 +13,7 @@
#define ESC 0x1B /* \e or \033 */
#define PH 1 /* panel height */
#define JUMP_NUM 14 /* how long ctrl + u/d jump are */
typedef struct {
WINDOW *window;
@ -139,23 +140,43 @@ int main(int argc, char** argv)
else if (focus == 1) focus--;
break;
*/
/* jump up */
case '\x15':
if ((current_selection - JUMP_NUM) > 0)
current_selection -= JUMP_NUM;
else
current_selection = 0;
highlight_current_line();
break;
/* go up */
case 'k':
if (current_selection > 0)
current_selection--;
highlight_current_line();
break;
/* jump down */
case '\x04':
if ((current_selection + JUMP_NUM) < (files_len() - 1))
current_selection += JUMP_NUM;
else
current_selection = (files_len() - 1);
highlight_current_line();
break;
/* go down */
case 'j':
if (current_selection < files_len() - 1)
if (current_selection < (files_len() - 1))
current_selection++;
highlight_current_line();
break;
/* jump to the bottom */
case 'G':
current_selection = files_len() - 1;
current_selection = (files_len() - 1);
highlight_current_line();
break;
/* jump to the top */