1
0
forked from aniani/vim

patch 8.2.3731: "set! termcap" shows codes in one column, but not keys

Problem:    "set! termcap" shows codes in one column, but not keys.
Solution:   Also use one column for keys. (closes #9258)
This commit is contained in:
Bram Moolenaar
2021-12-03 20:43:24 +00:00
parent 800b01b0c8
commit 15a24f0898
5 changed files with 48 additions and 12 deletions

View File

@@ -6217,9 +6217,10 @@ gather_termleader(void)
/*
* Show all termcodes (for ":set termcap")
* This code looks a lot like showoptions(), but is different.
* "flags" can have OPT_ONECOLUMN.
*/
void
show_termcodes(void)
show_termcodes(int flags)
{
int col;
int *items;
@@ -6244,12 +6245,13 @@ show_termcodes(void)
msg_puts_title(_("\n--- Terminal keys ---"));
/*
* do the loop two times:
* Do the loop three times:
* 1. display the short items (non-strings and short strings)
* 2. display the medium items (medium length strings)
* 3. display the long items (remaining strings)
* When "flags" has OPT_ONECOLUMN do everything in 3.
*/
for (run = 1; run <= 3 && !got_int; ++run)
for (run = (flags & OPT_ONECOLUMN) ? 3 : 1; run <= 3 && !got_int; ++run)
{
/*
* collect the items in items[]
@@ -6259,9 +6261,10 @@ show_termcodes(void)
{
len = show_one_termcode(termcodes[i].name,
termcodes[i].code, FALSE);
if (len <= INC3 - GAP ? run == 1
if ((flags & OPT_ONECOLUMN) ||
(len <= INC3 - GAP ? run == 1
: len <= INC2 - GAP ? run == 2
: run == 3)
: run == 3))
items[item_count++] = i;
}