- Timestamp:
- May 29, 2010, 1:13:50 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.7, release-1.8, release-1.9
- Children:
- 44cc9ab
- Parents:
- 89ce405
- git-author:
- David Benjamin <davidben@mit.edu> (05/24/10 14:51:11)
- git-committer:
- David Benjamin <davidben@mit.edu> (05/29/10 13:13:50)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
keymap.c
r8a921b5 r13ebf92 1 1 #include <string.h> 2 2 #include "owl.h" 3 4 static void _owl_keymap_format_bindings(const owl_keymap *km, owl_fmtext *fm); 5 static void _owl_keymap_format_with_submaps(const owl_keymap *km, owl_fmtext *fm); 3 6 4 7 /* returns 0 on success */ … … 86 89 87 90 /* Appends details about the keymap to fm */ 88 void owl_keymap_get_details(const owl_keymap *km, owl_fmtext *fm) 89 { 90 int i, nbindings; 91 const owl_keybinding *kb; 92 91 void owl_keymap_get_details(const owl_keymap *km, owl_fmtext *fm, int recurse) 92 { 93 93 owl_fmtext_append_bold(fm, "KEYMAP - "); 94 94 owl_fmtext_append_bold(fm, km->name); … … 119 119 120 120 owl_fmtext_append_bold(fm, "\nKey bindings:\n\n"); 121 if (recurse) { 122 _owl_keymap_format_with_submaps(km, fm); 123 } else { 124 _owl_keymap_format_bindings(km, fm); 125 } 126 } 127 128 static void _owl_keymap_format_with_submaps(const owl_keymap *km, owl_fmtext *fm) 129 { 130 while (km) { 131 _owl_keymap_format_bindings(km, fm); 132 km = km->submap; 133 if (km) { 134 owl_fmtext_append_bold(fm, "\nInherited from "); 135 owl_fmtext_append_bold(fm, km->name); 136 owl_fmtext_append_bold(fm, ":\n\n"); 137 } 138 } 139 } 140 141 static void _owl_keymap_format_bindings(const owl_keymap *km, owl_fmtext *fm) 142 { 143 int i, nbindings; 144 const owl_keybinding *kb; 145 121 146 nbindings = owl_list_get_size(&km->bindings); 122 147 for (i=0; i<nbindings; i++) {
Note: See TracChangeset
for help on using the changeset viewer.