comparison src/eval.c @ 23322:68df9697667a v8.2.2206

patch 8.2.2206: :exe command line completion only works for first argument Commit: https://github.com/vim/vim/commit/4941b5effd7f6a26583a949c92ee50276a3b43f9 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Dec 24 17:15:53 2020 +0100 patch 8.2.2206: :exe command line completion only works for first argument Problem: :exe command line completion only works for first argument. Solution: Skip over text if more is following. (closes https://github.com/vim/vim/issues/7546)
author Bram Moolenaar <Bram@vim.org>
date Thu, 24 Dec 2020 17:30:04 +0100
parents d5919c5fd3dc
children cdb706d5c43d
comparison
equal deleted inserted replaced
23321:86d163526c2d 23322:68df9697667a
1902 arg = xp->xp_pattern; 1902 arg = xp->xp_pattern;
1903 if (*arg != NUL) 1903 if (*arg != NUL)
1904 while ((c = *++arg) != NUL && (c == ' ' || c == '\t')) 1904 while ((c = *++arg) != NUL && (c == ' ' || c == '\t'))
1905 /* skip */ ; 1905 /* skip */ ;
1906 } 1906 }
1907
1908 // ":exe one two" completes "two"
1909 if ((cmdidx == CMD_execute
1910 || cmdidx == CMD_echo
1911 || cmdidx == CMD_echon
1912 || cmdidx == CMD_echomsg)
1913 && xp->xp_context == EXPAND_EXPRESSION)
1914 {
1915 for (;;)
1916 {
1917 char_u *n = skiptowhite(arg);
1918
1919 if (n == arg || IS_WHITE_OR_NUL(*skipwhite(n)))
1920 break;
1921 arg = skipwhite(n);
1922 }
1923 }
1924
1907 xp->xp_pattern = arg; 1925 xp->xp_pattern = arg;
1908 } 1926 }
1909 1927
1910 /* 1928 /*
1911 * Return TRUE if "pat" matches "text". 1929 * Return TRUE if "pat" matches "text".