The `mode()` function will return the state as it will be after applying the
operator.
-The `mode()` function will return the state as it will be after applying the
-operator.
-
Here is an example for using a lambda function to create a normal-mode
operator to add quotes around text in the current line: >
}
else
{
- if (flags & EW_NOTFOUND)
- STRCPY(command, "set nonomatch; ");
- else
- STRCPY(command, "unset nonomatch; ");
+ STRCPY(command, "");
+ if (shell_style == STYLE_GLOB)
+ {
+ // Assume the nonomatch option is valid only for csh like shells,
+ // otherwise, this may set the positional parameters for the shell,
+ // e.g. "$*".
+ if (flags & EW_NOTFOUND)
+ STRCAT(command, "set nonomatch; ");
+ else
+ STRCAT(command, "unset nonomatch; ");
+ }
if (shell_style == STYLE_GLOB)
STRCAT(command, "glob >");
else if (shell_style == STYLE_PRINT)
" Test for expanding file names
source shared.vim
+source check.vim
func Test_with_directories()
call mkdir('Xdir1')
%bwipe!
endfunc
+func Test_expandcmd_shell_nonomatch()
+ CheckNotMSWindows
+ call assert_equal('$*', expandcmd('$*'))
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab