1118
1124
map_print_key(EditLine *el, el_action_t *map, const char *in)
1120
1126
char outbuf[EL_BUFSIZ];
1127
el_bindings_t *bp, *ep;
1123
1129
if (in[0] == '\0' || in[1] == '\0') {
1124
(void) key__decode_str(in, outbuf, "");
1125
for (bp = el->el_map.help; bp->name != NULL; bp++)
1130
(void) key__decode_str(in, outbuf, sizeof(outbuf), "");
1131
ep = &el->el_map.help[el->el_map.nfunc];
1132
for (bp = el->el_map.help; bp < ep; bp++)
1126
1133
if (bp->func == map[(unsigned char) *in]) {
1127
1134
(void) fprintf(el->el_outfile,
1128
1135
"%s\t->\t%s\n", outbuf, bp->name);
1148
1155
lastbuf[0] = last;
1149
1156
lastbuf[1] = 0;
1150
1157
if (map[first] == ED_UNASSIGNED) {
1158
if (first == last) {
1159
(void) key__decode_str(firstbuf, unparsbuf,
1160
sizeof(unparsbuf), STRQQ);
1152
1161
(void) fprintf(el->el_outfile,
1153
"%-15s-> is undefined\n",
1154
key__decode_str(firstbuf, unparsbuf, STRQQ));
1162
"%-15s-> is undefined\n", unparsbuf);
1157
for (bp = el->el_map.help; bp->name != NULL; bp++) {
1166
ep = &el->el_map.help[el->el_map.nfunc];
1167
for (bp = el->el_map.help; bp < ep; bp++) {
1158
1168
if (bp->func == map[first]) {
1159
1169
if (first == last) {
1170
(void) key__decode_str(firstbuf, unparsbuf,
1171
sizeof(unparsbuf), STRQQ);
1160
1172
(void) fprintf(el->el_outfile, "%-15s-> %s\n",
1161
key__decode_str(firstbuf, unparsbuf, STRQQ),
1173
unparsbuf, bp->name);
1175
(void) key__decode_str(firstbuf, unparsbuf,
1176
sizeof(unparsbuf), STRQQ);
1177
(void) key__decode_str(lastbuf, extrabuf,
1178
sizeof(extrabuf), STRQQ);
1164
1179
(void) fprintf(el->el_outfile,
1165
1180
"%-4s to %-7s-> %s\n",
1166
key__decode_str(firstbuf, unparsbuf, STRQQ),
1167
key__decode_str(lastbuf, extrabuf, STRQQ),
1181
unparsbuf, extrabuf, bp->name);
1173
1186
#ifdef MAP_DEBUG
1174
1187
if (map == el->el_map.key) {
1188
(void) key__decode_str(firstbuf, unparsbuf,
1189
sizeof(unparsbuf), STRQQ);
1175
1190
(void) fprintf(el->el_outfile,
1176
"BUG!!! %s isn't bound to anything.\n",
1177
key__decode_str(firstbuf, unparsbuf, STRQQ));
1191
"BUG!!! %s isn't bound to anything.\n", unparsbuf);
1178
1192
(void) fprintf(el->el_outfile, "el->el_map.key[%d] == %d\n",
1179
1193
first, el->el_map.key[first]);
1195
(void) key__decode_str(firstbuf, unparsbuf,
1196
sizeof(unparsbuf), STRQQ);
1181
1197
(void) fprintf(el->el_outfile,
1182
"BUG!!! %s isn't bound to anything.\n",
1183
key__decode_str(firstbuf, unparsbuf, STRQQ));
1198
"BUG!!! %s isn't bound to anything.\n", unparsbuf);
1184
1199
(void) fprintf(el->el_outfile, "el->el_map.alt[%d] == %d\n",
1185
1200
first, el->el_map.alt[first]);