tybenz/vimdeck

syntax highliting with SyntaxRange fails with VAM

Closed this issue · 5 comments

I tried to have some code in a presentation, and realised, that because I use vim-addon-manager to activate SyntaxRange (so it is not in the vimpaths by default) the syntax highlighting does not work.
Is the .vimrc read after script.vim is sourced? That would explain this. All my settings are as expected and the syntax range commands work when I have the slides open so I have no idea why the syntax range stuff is not active when script.vim is sourced.

Just realised it does not work with syntax range installed by hand either. I can activate the syntax highlighting on the slides by calling SyntaxInclude but it is not active automatically.
I am using the example slides provided with the gem, by the way. If I should use the current github code, tell me.

Not sure about the first question. I installed SyntaxRange via vundle, but it shouldn't matter. script.vim is sourced through the -S command on VIM itself.

The command to open VIM is literally just vim presentation/*.md -S presentation/script.vim

Not sure why there would be any problems.

Can you post a gist of everything in your presentation directory?

I used your example, but here is a shorter version:
https://gist.github.com/Garonenur/6734796
there is another problem: numbered lists have no numbers.

You're right about the numbered list. I filed a separate bug here: #8.

I can't reproduce the problem on my end though. There must be some other issue. It could be that .vimrc is sourced after script.vim. But I don't think that's the case because Vundle sources SyntaxRange for me from my .vimrc.

Just to be sure. Do the following:

  1. Open vim with vim presentation/*.md
  2. Once in VIM, do :source presentation/script.vim

If it's still not working then it's a separate issue. There might be a conflict with some other vim plugin that you're using.

Okay, here is a thing: SyntaxRange works, but if I have multiple buffers open, and change from one to another (not in tabs or windows, hidden buffers like the slides). Then the syntax highlighting will revert to the default.
Because that is what happens with the slides, they get opened, the syntax highlighting is done and in the end buffer 1 is pulled to the foreground. Thats when my vim forgets all SyntaxRange has told it. Right now I have no Idea why.
If I find the reason, I'll pull request and change the template to set what ever is wrong to the right setting.