call StopVimInTerminal(buf)
endfunc
+" Test for listing user commands.
+func Test_command_list_0()
+ " Check space padding of attribute and name in command list
+ set vbs&
+ command! ShortCommand echo "ShortCommand"
+ command! VeryMuchLongerCommand echo "VeryMuchLongerCommand"
+
+ redi @"> | com | redi END
+ pu
+
+ let bl = matchbufline(bufnr('%'), "^ ShortCommand 0", 1, '$')
+ call assert_false(bl == [])
+ let bl = matchbufline(bufnr('%'), "^ VeryMuchLongerCommand 0", 1, '$')
+ call assert_false(bl == [])
+
+ bwipe!
+ delcommand ShortCommand
+ delcommand VeryMuchLongerCommand
+endfunc
" vim: shiftwidth=2 sts=2 expandtab
msg_putchar('|');
--len;
}
- while (len-- > 0)
- msg_putchar(' ');
+ if (len != 0)
+ msg_puts(&" "[4 - len]);
msg_outtrans_attr(cmd->uc_name, HL_ATTR(HLF_D));
len = (int)cmd->uc_namelen + 4;
- do
+ if (len < 21)
{
- msg_putchar(' ');
- ++len;
- } while (len < 22);
+ // Field padding spaces 12345678901234567
+ static char spaces[18] = " ";
+ msg_puts(&spaces[len - 4]);
+ len = 21;
+ }
+ msg_putchar(' ');
+ ++len;
// "over" is how much longer the name is than the column width for
// the name, we'll try to align what comes after.