updated for version 7.2a
diff --git a/runtime/macros/less.sh b/runtime/macros/less.sh
index 256936b..484c714 100755
--- a/runtime/macros/less.sh
+++ b/runtime/macros/less.sh
@@ -2,8 +2,17 @@
# Shell script to start Vim with less.vim.
# Read stdin if no arguments were given.
-if test $# = 0; then
- vim --cmd 'let no_plugin_maps = 1' -c 'runtime! macros/less.vim' -
+if test -t 1; then
+ if test $# = 0; then
+ vim --cmd 'let no_plugin_maps = 1' -c 'runtime! macros/less.vim' -
+ else
+ vim --cmd 'let no_plugin_maps = 1' -c 'runtime! macros/less.vim' "$@"
+ fi
else
- vim --cmd 'let no_plugin_maps = 1' -c 'runtime! macros/less.vim' "$@"
+ # Output is not a terminal, cat arguments or stdin
+ if test $# = 0; then
+ cat
+ else
+ cat "$@"
+ fi
fi