patch 9.1.1437: MS-Windows: internal compile error in uc_list() Commit: https://github.com/vim/vim/commit/0174d8f3863067269f00c1e1be83b699372ca21e Author: Mike Williams <mrmrdu...@gmail.com> Date: Sun Jun 8 15:41:52 2025 +0200
patch 9.1.1437: MS-Windows: internal compile error in uc_list() Problem: MS-Windows: internal compile error in uc_list() with VS 17.14 (ibear) Solution: refactor code slightly (Mike Williams) fixes: #17402 closes: #17464 Signed-off-by: Mike Williams <mrmrdu...@gmail.com> Signed-off-by: Christian Brabandt <c...@256bit.org> diff --git a/src/testdir/test_usercommands.vim b/src/testdir/test_usercommands.vim index deea5dfa3..d950308ee 100644 --- a/src/testdir/test_usercommands.vim +++ b/src/testdir/test_usercommands.vim @@ -965,5 +965,24 @@ func Test_comclear_while_listing() 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 diff --git a/src/usercmd.c b/src/usercmd.c index ded11e759..9f1efb4b7 100644 --- a/src/usercmd.c +++ b/src/usercmd.c @@ -600,17 +600,21 @@ uc_list(char_u *name, size_t name_len) 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. diff --git a/src/version.c b/src/version.c index 31f1854d5..3d83858ba 100644 --- a/src/version.c +++ b/src/version.c @@ -709,6 +709,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1437, /**/ 1436, /**/ -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/vim_dev/E1uOGZB-007Tzb-5Y%40256bit.org.