from-* query
- [X] Disable <hide> if cursor is in the hidden region.
- [X] fill mode to handle all punctuation at start of this line
-- [ ] Enable lib-menu to show short-cut keys
+- [X] Enable lib-menu to show short-cut keys
- [ ] Add menu-bar to lib-menu. Pop it up on F10 with simple commands
- [ ] attach an extensible menu to the selection
copy, paste-in, QR, git-view
### lib-menu
-- [ ] Enable lib-menu to show short-cut keys
+- [X] Enable lib-menu to show short-cut keys
- [ ] menu-bar to which we can add menus from which commands are sent
- [ ] track movement so entry under cursor can be highlighted
- [ ] support positioning above the target is no space below.
free(s);
return 1;
}
+ if (ci->str && strcmp(ci->str, "shortcut") == 0) {
+ char *s = call_ret(str, "doc:get-attr", ci->home,
+ 0, ci->mark, "value");
+ /* a leading space on 'value' suppresses listing as a shortcut */
+ char *v = (s && *s != ' ') ? s : "";
+ comm_call(ci->comm2, "cb", ci->focus, 0, ci->mark,
+ v, 0, NULL, ci->str);
+ free(s);
+ return 1;
+ }
return Efallthrough;
}
attr_set_str(&docp->attrs, "render-simple", "format");
attr_set_int(&docp->attrs, "render-wrap", 0);
attr_set_str(&docp->attrs, "heading", "");
- attr_set_str(&docp->attrs, "line-format", "<%BG><action-activate:menu-select>%name</></>");
+ if (ci->num & 1)
+ /* show the 'value' - presumably a key name */
+ attr_set_str(&docp->attrs, "line-format", "<%BG><action-activate:menu-select>%name<rtab>%shortcut</></>");
+ else
+ attr_set_str(&docp->attrs, "line-format", "<%BG><action-activate:menu-select>%name</></>");
attr_set_str(&docp->attrs, "done-key", ci->str2 ?: "menu-done");
/* No borders, just a shaded background to make menu stand out */
attr_set_str(&docp->attrs, "borders", "");