+static void nav_stack(char dir) //
+{
+ FILE * file = fopen("test", "a");
+ fprintf(file, "called %d\n", world.things_here_scroll);
+ if ('u' == dir && world.things_here_scroll > 0)
+ {
+ world.things_here_scroll--;
+ fprintf(file, "u\n");
+ }
+ else if ('d' == dir && world.things_here)
+ {
+ uint32_t i;
+ uint32_t n_lines = 1;
+ for (i = 0; '\0' != world.things_here[i]; i++)
+ {
+ n_lines = n_lines + (world.things_here[i] == '\n');
+ }
+ uint16_t f_h = get_win_by_id('s')->frame_size.y;
+ fprintf(file, "%d %d\n", n_lines, f_h);
+ if (n_lines > f_h && world.things_here_scroll < n_lines - f_h)
+ {
+ world.things_here_scroll++;
+ }
+ fprintf(file, "d %d\n", world.things_here_scroll);
+ }
+ fclose(file);
+}
+
+
+
static uint8_t try_0args(struct Command * command, char * match, void (* f) ())
{
if (!strcmp(command->dsc_short, match))
{
return ( try_1args(command, "inv_u", nav_inventory, 'u')
|| try_1args(command, "inv_d", nav_inventory, 'd')
+ || try_1args(command, "stack_u", nav_stack, 'u') //
+ || try_1args(command, "stack_d", nav_stack, 'd') //
|| try_1args(command, "cyc_win_f", cycle_active_win, 'f')
|| try_1args(command, "cyc_win_b", cycle_active_win, 'b')
|| try_1args(command, "scrl_r", scroll_v_screen, '+')
|| try_1args(command, "grow_v", resize_active_win, '+')
|| try_1args(command, "shri_v", resize_active_win, '-')
|| try_0args(command, "to_break", toggle_linebreak_type)
- || try_1args(command, "to_height_t", toggle_win_size_type, 'Y') //
- || try_1args(command, "to_width_t", toggle_win_size_type, 'X') //
+ || try_1args(command, "to_height_t", toggle_win_size_type, 'y')
+ || try_1args(command, "to_width_t", toggle_win_size_type, 'x')
|| try_1args(command, "shift_f", shift_active_win, 'f')
|| try_1args(command, "shift_b", shift_active_win, 'b')
|| try_0args(command, "reload_conf", reload_interface_conf)