summaryrefslogtreecommitdiff
path: root/runtime/macros
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2008-06-24 20:39:31 +0000
committerBram Moolenaar <Bram@vim.org>2008-06-24 20:39:31 +0000
commita7241f5f19fd0865ce697939c347a8c88fb507d5 (patch)
treee1f1c07fe74094539286be048cc3306f6aedb0bc /runtime/macros
parentf233048a129fa7a3b89e064078435181d6421da5 (diff)
downloadvim-git-a7241f5f19fd0865ce697939c347a8c88fb507d5.tar.gz
updated for version 7.2a
Diffstat (limited to 'runtime/macros')
-rwxr-xr-xruntime/macros/less.sh15
1 files changed, 12 insertions, 3 deletions
diff --git a/runtime/macros/less.sh b/runtime/macros/less.sh
index 256936b5e..484c714ce 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