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