#define BINDING_JUMP_BOTTOM 'G'
#define BINDING_MOVE_ITEM_UP 'K'
#define BINDING_MOVE_ITEM_DOWN 'J'
+#define BINDING_MOVE_ITEM_LEFT 'H'
+#define BINDING_MOVE_ITEM_RIGHT 'L'
#define BINDING_DELETE_ITEM 'D'
#define BINDING_SELECT '\n'
#define BINDING_APPEND_ITEM 'a'
#define BINDING_INSERT_ABOVE 'O'
#define BINDING_INSERT_BELOW 'o'
+#define BINDING_EDIT_ITEM 'i'
#endif
MENU_DELETE,
MENU_APPEND,
MENU_INSERT_ABOVE,
- MENU_INSERT_BELOW
+ MENU_INSERT_BELOW,
+ MENU_EDIT
} MenuAction;
typedef struct Menu Menu;
case MENU_APPEND:
insert_item(menu, menu->menu_length);
- wclear(menu->sub_win);
+ menu_insert_mode(menu, menu->selected_item);
break;
case MENU_INSERT_ABOVE:
- ;
- int insert_ind = menu->selected_item;
- insert_item(menu, insert_ind);
- menu_insert_mode(menu, insert_ind);
-
+ insert_item(menu, menu->selected_item);
+ menu_insert_mode(menu, menu->selected_item);
break;
case MENU_INSERT_BELOW:
- insert_item(menu,
- (menu->selected_item >= menu->menu_length-1) ? menu->menu_length : menu->selected_item+1
- );
- wclear(menu->sub_win);
+ insert_item(menu, menu->selected_item+1);
+ menu_insert_mode(menu, menu->selected_item); // inserted item is cur now
+ break;
+ case MENU_EDIT:
+ menu_insert_mode(menu, menu->selected_item);
break;
default: // This is here for debug, disable later
break;
case BINDING_MOVE_ITEM_DOWN:
menu_driver(active_menu, MENU_MOVE_DOWN);
+ break;
+ case BINDING_MOVE_ITEM_LEFT:
+
+ break;
+ case BINDING_MOVE_ITEM_RIGHT:
+
break;
case BINDING_DELETE_ITEM:
menu_driver(active_menu, MENU_DELETE);
case BINDING_INSERT_BELOW:
menu_driver(active_menu, MENU_INSERT_BELOW);
break;
+ case BINDING_EDIT_ITEM:
+ menu_driver(active_menu, MENU_EDIT);
+ break;
}
for (int i = 0; i < boardmenu->menu_count; i++) {