From 8e53682e9188dd9f4e48015fdd82520f8068a17d Mon Sep 17 00:00:00 2001 From: anon Date: Fri, 4 Aug 2023 22:35:56 +0200 Subject: [PATCH] meh --- src/input.c | 8 ++++---- src/readline.c | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/input.c b/src/input.c index 7fe3666..293b050 100644 --- a/src/input.c +++ b/src/input.c @@ -417,7 +417,7 @@ global_input(const int c){ case '+': case ctrl('V'): case KEY_NPAGE: - if (totallines == 0) { return(NO); } /* don't redisplay if there are no lines */ + if (totallines == 0) { return 0; } /* don't redisplay if there are no lines */ /* XXX: figure out whether this comment is useful or not */ /* NOTE: seekline() is not used to move to the next * page because display() leaves the file pointer at @@ -428,7 +428,7 @@ global_input(const int c){ case ctrl('H'): /* display previous page */ case '-': case KEY_PPAGE: - if (totallines == 0) { return(NO); } /* don't redisplay if there are no lines */ + if (totallines == 0) { return 0; } /* don't redisplay if there are no lines */ curdispline = 0; /* if there are only two pages, just go to the other one */ if (totallines <= 2 * mdisprefs) { @@ -498,13 +498,13 @@ global_input(const int c){ // return(YES); //} //clearprompt(); - return(NO); + return 0; case '|': /* pipe the lines to a shell command */ case '^': break; // XXX fix if (totallines == 0) { postmsg("There are no lines to pipe to a shell command"); - return(NO); + return 0; } /* get the shell command */ move(PRLINE, 0); diff --git a/src/readline.c b/src/readline.c index 6bef298..cd9c5b9 100644 --- a/src/readline.c +++ b/src/readline.c @@ -2,6 +2,7 @@ #include #include "global.h" #include "build.h" +#include extern int LINES; // XXX @@ -127,7 +128,10 @@ void rlinit(){ rl_redisplay_function = redisplay_function; rl_callback_handler_install("", callback_handler); - rl_bind_key(EOF, interpret_break); + rl_bind_key(7, rl_rubout); // XXX: 7 is backspace for some reason (on my system anyways?) + rl_bind_key(KEY_BACKSPACE, rl_rubout); + + rl_bind_key(EOF, exit); rl_bind_key(ctrl('D'), interpret_break); //XXX: why the fuck does it not work if its the first char? rl_bind_key(ctrl('Z'), ctrl_z); rl_bind_key(ctrl('Z'), toggle_caseless);