From ee7ae78c4e16bc81af90eb0f56f73205edb78b52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Fri, 3 Jul 2015 13:02:58 +0200 Subject: [PATCH] Ensure the command is only added once. --- ftplugin/objc_open_selection_in_xcode.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ftplugin/objc_open_selection_in_xcode.vim b/ftplugin/objc_open_selection_in_xcode.vim index afbe8ed..04d0656 100644 --- a/ftplugin/objc_open_selection_in_xcode.vim +++ b/ftplugin/objc_open_selection_in_xcode.vim @@ -1 +1,6 @@ -command Xcode call system("xcrun xed -l " . line(".") . " " . fnameescape(expand('%:p')) . " && echo 'tell application \"Xcode-Beta\"\\nactivate\\nend tell\\ntell application \"System Events\"\\ntell application process \"Xcode\"\\nclick menu item \"Jump to Selection\" of menu \"Navigate\" of menu bar 1\\nend tell\\nend tell' | osascript") +if exists('s:did_add_open_in_xcode') + finish +endif +let s:did_add_open_in_xcode = 1 + +command Xcode call system("xcrun xed -l " . line(".") . " " . fnameescape(expand('%:p')) . " && echo 'tell application \"Xcode\"\\nactivate\\nend tell\\ntell application \"System Events\"\\ntell application process \"Xcode\"\\nclick menu item \"Jump to Selection\" of menu \"Navigate\" of menu bar 1\\nend tell\\nend tell' | osascript")