This commit is contained in:
anon 2023-08-04 22:35:56 +02:00
parent 7bd8ab5f10
commit 8e53682e91
2 changed files with 9 additions and 5 deletions

View File

@ -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);

View File

@ -2,6 +2,7 @@
#include <readline/readline.h>
#include "global.h"
#include "build.h"
#include <ncurses.h>
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);