summaryrefslogtreecommitdiff
path: root/plugins/vim-interaction
diff options
context:
space:
mode:
authorAndrew Janke <andrew@apjanke.net>2015-09-23 18:53:05 -0400
committerAndrew Janke <andrew@apjanke.net>2015-09-23 18:53:05 -0400
commit96ff86142e9037e707f9cde8ab69e0425a0559c6 (patch)
tree217cb5e2b4a1c55afec79984c3c3c0a9efe2bf69 /plugins/vim-interaction
parent502f08b5e19716d43a7ec8b006178a7b017f68cd (diff)
parent76a26a2a59d8c6d0f65a4426cdb93920e255aea7 (diff)
downloadzsh-96ff86142e9037e707f9cde8ab69e0425a0559c6.tar.gz
zsh-96ff86142e9037e707f9cde8ab69e0425a0559c6.tar.bz2
zsh-96ff86142e9037e707f9cde8ab69e0425a0559c6.zip
Merge branch 'master' into installer-cygwin-support-3
Conflicts: tools/install.sh
Diffstat (limited to 'plugins/vim-interaction')
-rw-r--r--plugins/vim-interaction/vim-interaction.plugin.zsh22
1 files changed, 4 insertions, 18 deletions
diff --git a/plugins/vim-interaction/vim-interaction.plugin.zsh b/plugins/vim-interaction/vim-interaction.plugin.zsh
index b0b9414cd..b774be342 100644
--- a/plugins/vim-interaction/vim-interaction.plugin.zsh
+++ b/plugins/vim-interaction/vim-interaction.plugin.zsh
@@ -4,17 +4,6 @@
# Derek Wyatt (derek@{myfirstnamemylastname}.org
#
-function resolveFile
-{
- if [ -f "$1" ]; then
- echo $(readlink -f "$1")
- elif [[ "${1#/}" == "$1" ]]; then
- echo "$PWD/$1"
- else
- echo $1
- fi
-}
-
function callvim
{
if [[ $# == 0 ]]; then
@@ -48,13 +37,10 @@ EOH
if [[ ${before#:} != $before && ${before%<cr>} == $before ]]; then
before="$before<cr>"
fi
- local files=""
- for f in $@
- do
- files="$files $(resolveFile $f)"
- done
- if [[ -n $files ]]; then
- files=':args! '"$files<cr>"
+ local files
+ if [[ $# -gt 0 ]]; then
+ # absolute path of files resolving symlinks (:A) and quoting special chars (:q)
+ files=':args! '"${@:A:q}<cr>"
fi
cmd="$before$files$after"
gvim --remote-send "$cmd"