1
1
mirror of https://github.com/profanity-im/profanity.git synced 2025-02-02 15:08:15 -05:00

Fixed arrow keys with debug

This commit is contained in:
James Booth 2015-02-02 23:17:47 +00:00
parent 5954c0d2fe
commit 1c157b04df
2 changed files with 3 additions and 7 deletions

View File

@ -97,7 +97,6 @@ ui_init(void)
nonl(); nonl();
cbreak(); cbreak();
noecho(); noecho();
leaveok(stdscr, FALSE);
keypad(stdscr, TRUE); keypad(stdscr, TRUE);
if (prefs_get_boolean(PREF_MOUSE)) { if (prefs_get_boolean(PREF_MOUSE)) {
mousemask(ALL_MOUSE_EVENTS, NULL); mousemask(ALL_MOUSE_EVENTS, NULL);

View File

@ -102,7 +102,7 @@ cb_linehandler(char *line)
int int
prof_rl_getc(FILE *filein) prof_rl_getc(FILE *filein)
{ {
int ch = getc(stdin); int ch = rl_getc(filein);
if (_printable(ch)) { if (_printable(ch)) {
cmd_reset_autocomplete(); cmd_reset_autocomplete();
} }
@ -293,13 +293,11 @@ startup_hook(void)
void void
create_input_window(void) create_input_window(void)
{ {
/*
#ifdef NCURSES_REENTRANT #ifdef NCURSES_REENTRANT
set_escdelay(25); set_escdelay(25);
#else #else
ESCDELAY = 25; ESCDELAY = 25;
#endif #endif
*/
p_rl_timeout.tv_sec = 0; p_rl_timeout.tv_sec = 0;
p_rl_timeout.tv_usec = inp_timeout * 1000; p_rl_timeout.tv_usec = inp_timeout * 1000;
@ -433,16 +431,15 @@ inp_readline(void)
if (FD_ISSET(fileno(rl_instream), &fds)) { if (FD_ISSET(fileno(rl_instream), &fds)) {
rl_callback_read_char(); rl_callback_read_char();
cons_debug("LINE: %s", rl_line_buffer);
cons_debug("POS : %d", rl_point);
if (rl_line_buffer && rl_line_buffer[0] != '/' && rl_line_buffer[0] != '\0' && rl_line_buffer[0] != '\n') { if (rl_line_buffer && rl_line_buffer[0] != '/' && rl_line_buffer[0] != '\0' && rl_line_buffer[0] != '\n') {
prof_handle_activity(); prof_handle_activity();
} }
ui_reset_idle_time(); ui_reset_idle_time();
inp_nonblocking(TRUE); cons_show("");
inp_write(rl_line_buffer, rl_point); inp_write(rl_line_buffer, rl_point);
inp_nonblocking(TRUE);
} else { } else {
inp_nonblocking(FALSE); inp_nonblocking(FALSE);
prof_handle_idle(); prof_handle_idle();