On Jul 18, 12:49 am, Dan <[email protected]> wrote:
> Hello,
>
> I have recently set up MacVim 7.2 snapshot 52 as an external editor
> with Xcode and I have installed cocoa.vim script from vim.org into my
> home .vim directory.  Now using vim from the terminal, cocoa.vim works
> fine and I receive all the cocoa objective-C syntax enhancements when
> working with objc files.  However, MacVim fails to do the same.
>
> After a little a investigation with using the ':scriptnames' command I
> found the that MacVim would load the following syntax files in this
> exact order:
>
>  30: /Users/Dan/.vim/after/syntax/objc_enhanced.vim
>  31: /Users/Dan/.vim/after/syntax/cocoa_keywords.vim
>  32: /Applications/MacVim-snapshot-52/MacVim.app/Contents/Resources/
> vim/runtime/syntax/objc.vim
>  33: /Applications/MacVim-snapshot-52/MacVim.app/Contents/Resources/
> vim/runtime/syntax/c.vim
>
> So it appeared that MacVim's internal objc.vim file would clobber the
> loaded enhancements from "objc_enhanced.vim".  Shouldn't MacVim load
> the "$HOME/.vim/after/syntax" directory after it loads its own
> internal syntax files?  I'm not sure if this is an issue worthy to be
> reported as a bug.
>
> As a quick and dirty fix I copied "objc_enchance.vim" and
> "cocoa_keywords.vim" to MacVim's "runtime/syntax" directory and added
> "ru syntax/objc_enhanced.vim" to the bottom of the "syntax/objc.vim"
> file.  I realize that this is probably not the best way to get around
> the issue but it worked for me.
>
> - Dan

Each script is listed only once by :scriptnames, in the order they
were _first_ sourced; but each syntax script is sourced again for each
edit file of that syntax. From what you say, I can only conclude that
the first "objc-enhanced" file was sourced before the first "objc"
file — or else, the file was detected as one syntax, and the script
for that syntax invoked the script for another syntax: for instance,
at line 21 of $VIMRUNTIME/syntax/objc.vim I see "runtime! syntax/
c.vim" which will, at that point, source the syntax/c.vim script from
all 'runtimepath' trees in sequence. At that point, objc.vim had not
yet finished running, but it is listed before c.vim because it
_started_ before it.

Best regards,
Tony.
--
Higgeldy Piggeldy,
Hamlet of Elsinore
Ruffled the critics by
Dropping this bomb:
"Phooey on Freud and his
Psychoanalysis --
Oedipus, Shmoedipus,
I just love Mom."

-- 
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to