#include "draw_wins.h"
#include <ncurses.h> /* attri_t, chtype */
+#include <stddef.h> /* NULL */
#include <stdint.h> /* uint8_t, uint16_t, uint32_t, int16_t */
#include <stdio.h> /* for sprintf() */
#include <stdlib.h> /* free() */
#include <string.h> /* strlen(), strtok() */
-#include "../common/try_malloc.h" /* for try_malloc() */
-#include "command_db.h" /* for get_command_longdsc */
+#include "../common/try_malloc.h" /* try_malloc() */
#include "keybindings.h" /* struct KeyBinding, get_keyname_to_keycode() */
#include "wincontrol.h" /* struct WinConf, get_winconf_by_win() */
#include "windows.h" /* struct Win */
char * f_name = "get_kb_line_and_iterate()";
struct KeyBinding * kb_p = * kb_pp;
char * keyname = get_keyname_to_keycode(kb_p->key);
- char * cmd_dsc = get_command_longdsc(kb_p->command);
- uint16_t size = 9 + 1 + strlen(cmd_dsc) + 1;
+ struct Command * command = get_command_to_keycode(kb_p, kb_p->key);
+ uint16_t size = 9 + 1 + strlen(command->dsc_long) + 1;
char * line = try_malloc(size, f_name);
- sprintf(line, "%-9s %s", keyname, cmd_dsc);
+ sprintf(line, "%-9s %s", keyname, command->dsc_long);
free(keyname);
* kb_pp = kb_p->next;
return line;
{
char * title = "Active window's keybindings:";
struct KeyBinding * kb_p;
- struct WinConf * wc = get_winconf_by_win(world.wmeta.active);
+ struct WinConf * wc = get_winconf_by_win(world.wins.win_active);
if (0 == wc->view)
{
kb_p = wc->kb.kbs;