File src/hstr.c changed (mode: 100644) (index 6f1e864..9c19d24) |
49 |
49 |
#define Y_OFFSET_HISTORY 2 |
#define Y_OFFSET_HISTORY 2 |
50 |
50 |
#define Y_OFFSET_ITEMS 3 |
#define Y_OFFSET_ITEMS 3 |
51 |
51 |
|
|
|
52 |
|
#define PG_JUMP_SIZE 10 |
|
53 |
|
|
52 |
54 |
#define K_CTRL_A 1 |
#define K_CTRL_A 1 |
53 |
55 |
#define K_CTRL_E 5 |
#define K_CTRL_E 5 |
54 |
56 |
#define K_CTRL_F 6 |
#define K_CTRL_F 6 |
|
... |
... |
void loop_to_select(Hstr *hstr) |
861 |
863 |
} |
} |
862 |
864 |
|
|
863 |
865 |
switch (c) { |
switch (c) { |
|
866 |
|
case KEY_HOME: |
|
867 |
|
// TODO implement in pattern cursor jump to beginning |
|
868 |
|
break; |
|
869 |
|
case KEY_END: |
|
870 |
|
// TODO implement in pattern cursor jump to end |
|
871 |
|
break; |
864 |
872 |
case KEY_DC: // DEL |
case KEY_DC: // DEL |
865 |
873 |
if(selectionCursorPosition!=SELECTION_CURSOR_IN_PROMPT) { |
if(selectionCursorPosition!=SELECTION_CURSOR_IN_PROMPT) { |
866 |
874 |
delete=hstr->selection[selectionCursorPosition]; |
delete=hstr->selection[selectionCursorPosition]; |
|
... |
... |
void loop_to_select(Hstr *hstr) |
988 |
996 |
highlight_selection(selectionCursorPosition, previousSelectionCursorPosition, pattern, hstr); |
highlight_selection(selectionCursorPosition, previousSelectionCursorPosition, pattern, hstr); |
989 |
997 |
move(y, basex+strlen(pattern)); |
move(y, basex+strlen(pattern)); |
990 |
998 |
break; |
break; |
|
999 |
|
case KEY_PPAGE: |
|
1000 |
|
previousSelectionCursorPosition=selectionCursorPosition; |
|
1001 |
|
if(selectionCursorPosition>=PG_JUMP_SIZE) { |
|
1002 |
|
selectionCursorPosition=selectionCursorPosition-PG_JUMP_SIZE; |
|
1003 |
|
} else { |
|
1004 |
|
selectionCursorPosition=0; |
|
1005 |
|
} |
|
1006 |
|
highlight_selection(selectionCursorPosition, previousSelectionCursorPosition, pattern, hstr); |
|
1007 |
|
move(y, basex+strlen(pattern)); |
|
1008 |
|
break; |
991 |
1009 |
case K_CTRL_R: |
case K_CTRL_R: |
992 |
1010 |
case KEY_DOWN: |
case KEY_DOWN: |
993 |
1011 |
case K_CTRL_N: |
case K_CTRL_N: |
|
... |
... |
void loop_to_select(Hstr *hstr) |
1006 |
1024 |
} |
} |
1007 |
1025 |
move(y, basex+strlen(pattern)); |
move(y, basex+strlen(pattern)); |
1008 |
1026 |
break; |
break; |
|
1027 |
|
case KEY_NPAGE: |
|
1028 |
|
if(selectionCursorPosition==SELECTION_CURSOR_IN_PROMPT) { |
|
1029 |
|
selectionCursorPosition=previousSelectionCursorPosition=0; |
|
1030 |
|
} else { |
|
1031 |
|
previousSelectionCursorPosition=selectionCursorPosition; |
|
1032 |
|
if((selectionCursorPosition+PG_JUMP_SIZE)<hstr->selectionSize) { |
|
1033 |
|
selectionCursorPosition = selectionCursorPosition+PG_JUMP_SIZE; |
|
1034 |
|
} else { |
|
1035 |
|
selectionCursorPosition=hstr->selectionSize-1; |
|
1036 |
|
} |
|
1037 |
|
} |
|
1038 |
|
if(hstr->selectionSize) { |
|
1039 |
|
highlight_selection(selectionCursorPosition, previousSelectionCursorPosition, pattern, hstr); |
|
1040 |
|
} |
|
1041 |
|
move(y, basex+strlen(pattern)); |
|
1042 |
|
break; |
1009 |
1043 |
case K_ENTER: |
case K_ENTER: |
1010 |
1044 |
case KEY_ENTER: |
case KEY_ENTER: |
1011 |
1045 |
executeResult=TRUE; |
executeResult=TRUE; |