nicer output
This commit is contained in:
parent
349ac3f0e3
commit
78a8588126
2 changed files with 6 additions and 5 deletions
|
@ -21,7 +21,8 @@ static void print_branch(BindingTree *first, std::string str)
|
|||
while (p) {
|
||||
if (p->first_child)
|
||||
print_branch(p->first_child, str + " " + p->text);
|
||||
printf("%d%s\n", p->id, (str + " " + p->text).c_str());
|
||||
if (!p->chain)
|
||||
printf("%d%s\n", p->id, (str + " " + p->text).c_str());
|
||||
BindingTree *s = p->next_sibling;
|
||||
delete p;
|
||||
p = s;
|
||||
|
@ -83,9 +84,8 @@ static BindingTree *buildtree(const OBBindings::StringVect &keylist, int id)
|
|||
p->chain = false;
|
||||
}
|
||||
|
||||
printf("<BUILDING>\n");
|
||||
printf("BUILDING:\n");
|
||||
print_branch(ret, "");
|
||||
printf("</BUILDING>\n");
|
||||
|
||||
// successfully built a tree
|
||||
return ret;
|
||||
|
|
|
@ -150,8 +150,8 @@ Openbox::Openbox(int argc, char **argv)
|
|||
_bindings = new OBBindings();
|
||||
|
||||
OBBindings::StringVect v;
|
||||
// v.push_back("C-x");
|
||||
// v.push_back("C-y");
|
||||
v.push_back("C-x");
|
||||
v.push_back("C-y");
|
||||
v.push_back("v");
|
||||
_bindings->add(v, 1);
|
||||
v.clear();
|
||||
|
@ -160,6 +160,7 @@ Openbox::Openbox(int argc, char **argv)
|
|||
v.push_back("a");
|
||||
_bindings->add(v, 2);
|
||||
|
||||
printf("CHAINS:\n");
|
||||
_bindings->display();
|
||||
::exit(0);
|
||||
|
||||
|
|
Loading…
Reference in a new issue