1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-25 13:55:34 -05:00

Do not refilter on cursor move

This commit is contained in:
QC 2015-08-29 23:02:30 +02:00
parent 9c53d0121d
commit 6c37c0d989
2 changed files with 12 additions and 7 deletions

View file

@ -1323,10 +1323,14 @@ MenuReturn menu ( char **lines, unsigned int num_lines, char **input, char *prom
state.quit = TRUE; state.quit = TRUE;
} }
// Key press is handled by entry box. // Key press is handled by entry box.
else if ( rc > 0 ) { else if ( rc == 1 ) {
state.refilter = TRUE; state.refilter = TRUE;
state.update = TRUE; state.update = TRUE;
} }
else if ( rc == 2 ) {
// redraw.
state.update = TRUE;
}
// Other keys. // Other keys.
else{ else{
// unhandled key // unhandled key

View file

@ -553,6 +553,7 @@ static void textbox_cursor_del_word ( textbox *tb )
} }
// handle a keypress in edit mode // handle a keypress in edit mode
// 2 = nav
// 0 = unhandled // 0 = unhandled
// 1 = handled // 1 = handled
// -1 = handled and return pressed (finished) // -1 = handled and return pressed (finished)
@ -579,12 +580,12 @@ int textbox_keypress ( textbox *tb, XEvent *ev )
// Left or Ctrl-b // Left or Ctrl-b
if ( abe_test_action ( MOVE_CHAR_BACK, ev->xkey.state, key ) ) { if ( abe_test_action ( MOVE_CHAR_BACK, ev->xkey.state, key ) ) {
textbox_cursor_dec ( tb ); textbox_cursor_dec ( tb );
return 1; return 2;
} }
// Right or Ctrl-F // Right or Ctrl-F
else if ( abe_test_action ( MOVE_CHAR_FORWARD, ev->xkey.state, key ) ) { else if ( abe_test_action ( MOVE_CHAR_FORWARD, ev->xkey.state, key ) ) {
textbox_cursor_inc ( tb ); textbox_cursor_inc ( tb );
return 1; return 2;
} }
// Ctrl-U: Kill from the beginning to the end of the line. // Ctrl-U: Kill from the beginning to the end of the line.
@ -595,12 +596,12 @@ int textbox_keypress ( textbox *tb, XEvent *ev )
// Ctrl-A // Ctrl-A
else if ( abe_test_action ( MOVE_FRONT, ev->xkey.state, key ) ) { else if ( abe_test_action ( MOVE_FRONT, ev->xkey.state, key ) ) {
textbox_cursor ( tb, 0 ); textbox_cursor ( tb, 0 );
return 1; return 2;
} }
// Ctrl-E // Ctrl-E
else if ( abe_test_action ( MOVE_END, ev->xkey.state, key ) ) { else if ( abe_test_action ( MOVE_END, ev->xkey.state, key ) ) {
textbox_cursor_end ( tb ); textbox_cursor_end ( tb );
return 1; return 2;
} }
// Ctrl-Alt-h // Ctrl-Alt-h
else if ( abe_test_action ( REMOVE_WORD_BACK, ev->xkey.state, key ) ) { else if ( abe_test_action ( REMOVE_WORD_BACK, ev->xkey.state, key ) ) {
@ -619,12 +620,12 @@ int textbox_keypress ( textbox *tb, XEvent *ev )
// Alt-B // Alt-B
else if ( abe_test_action ( MOVE_WORD_BACK, ev->xkey.state, key ) ) { else if ( abe_test_action ( MOVE_WORD_BACK, ev->xkey.state, key ) ) {
textbox_cursor_dec_word ( tb ); textbox_cursor_dec_word ( tb );
return 1; return 2;
} }
// Alt-F // Alt-F
else if ( abe_test_action ( MOVE_WORD_FORWARD, ev->xkey.state, key ) ) { else if ( abe_test_action ( MOVE_WORD_FORWARD, ev->xkey.state, key ) ) {
textbox_cursor_inc_word ( tb ); textbox_cursor_inc_word ( tb );
return 1; return 2;
} }
// BackSpace, Ctrl-h // BackSpace, Ctrl-h
else if ( abe_test_action ( REMOVE_CHAR_BACK, ev->xkey.state, key ) ) { else if ( abe_test_action ( REMOVE_CHAR_BACK, ev->xkey.state, key ) ) {