diff --git a/src/hstr.c b/src/hstr.c index 6f1e864..e57f6ff 100644 --- a/src/hstr.c +++ b/src/hstr.c @@ -49,6 +49,8 @@ #define Y_OFFSET_HISTORY 2 #define Y_OFFSET_ITEMS 3 +#define PG_JUMP_SIZE 10 + #define K_CTRL_A 1 #define K_CTRL_E 5 #define K_CTRL_F 6 @@ -861,6 +863,12 @@ void loop_to_select(Hstr *hstr) } switch (c) { + case KEY_HOME: + // avoids printing of wild chars in search prompt + break; + case KEY_END: + // avoids printing of wild chars in search prompt + break; case KEY_DC: // DEL if(selectionCursorPosition!=SELECTION_CURSOR_IN_PROMPT) { delete=hstr->selection[selectionCursorPosition]; @@ -988,6 +996,16 @@ void loop_to_select(Hstr *hstr) highlight_selection(selectionCursorPosition, previousSelectionCursorPosition, pattern, hstr); move(y, basex+strlen(pattern)); break; + case KEY_PPAGE: + previousSelectionCursorPosition=selectionCursorPosition; + if(selectionCursorPosition>=PG_JUMP_SIZE) { + selectionCursorPosition=selectionCursorPosition-PG_JUMP_SIZE; + } else { + selectionCursorPosition=0; + } + highlight_selection(selectionCursorPosition, previousSelectionCursorPosition, pattern, hstr); + move(y, basex+strlen(pattern)); + break; case K_CTRL_R: case KEY_DOWN: case K_CTRL_N: @@ -1006,6 +1024,22 @@ void loop_to_select(Hstr *hstr) } move(y, basex+strlen(pattern)); break; + case KEY_NPAGE: + if(selectionCursorPosition==SELECTION_CURSOR_IN_PROMPT) { + selectionCursorPosition=previousSelectionCursorPosition=0; + } else { + previousSelectionCursorPosition=selectionCursorPosition; + if((selectionCursorPosition+PG_JUMP_SIZE)selectionSize) { + selectionCursorPosition = selectionCursorPosition+PG_JUMP_SIZE; + } else { + selectionCursorPosition=hstr->selectionSize-1; + } + } + if(hstr->selectionSize) { + highlight_selection(selectionCursorPosition, previousSelectionCursorPosition, pattern, hstr); + } + move(y, basex+strlen(pattern)); + break; case K_ENTER: case KEY_ENTER: executeResult=TRUE;