jtratner / vim-flavored-markdown

159 stars 24 forks source link

filetype=markdown ? #13

Open morganprecision opened 11 years ago

morganprecision commented 11 years ago

In the autocmd block, should the filetype be markdown instead of ghmarkdown? Could this be something that changed recently?

If I specify ghmarkdown, the plugin still works, but whenever I have fenced code blocks, syntax highlighting doesn't work properly ... basically it's as if the fenced code block never ends; everything after it is highlighted.

If I specify filetype=markdown, all is well.

jtratner commented 11 years ago

I don't think this has changed recently. Could you try trimming down your vimrc and bundles so you just have pathogen, the necessary lines to start pathogen in your vimrc, and only this bundle in your bundles? That way we can figure out whether it's this bundle that's messed up or something else in your configuration. (def make a copy of your vimrc and such first).

Also, can you post an image of what you mean? (you can drag images into the comment box)

morganprecision commented 11 years ago

Wow, after a lot of fooling around with my vimrc, I narrowed it down to this line:

let g:solarized_hitrail=1

That seems to be what's causing the problem. Strangely, the syntax colors were working great today at work if I specify markdown instead of ghmarkdown for the file type, but I can't duplicate that right now at home. Unfortunately I didn't push my dotfiles before I left so I'll have to fool with it later. Anyway, I think the line above is the problem.

This is what it looks like when it's not working:

image

Thanks!

jtratner commented 11 years ago

@morganprecision if you're specifying markdown, it's using a markdown.vim file somewhere and not this repo's ghmarkdown.vim. Maybe the main markdown.vim now supports fenced highlighting? (or does solarized add that somehow?)

Anyways, here's the part of solarized colors that gets activated when g:solarized_hitrail == 1 (mostly for my reference for investigating this):

function! s:SolarizedHiTrail()
    if g:solarized_hitrail==0
        hi! clear solarizedTrailingSpace
    else
        syn match solarizedTrailingSpace "\s*$"
        exe "hi! solarizedTrailingSpace " .s:fmt_undr .s:fg_red .s:bg_none .s:sp_red
    endif
endfunction  
augroup SolarizedHiTrail
    autocmd!
    if g:solarized_hitrail==1
        autocmd! Syntax * call s:SolarizedHiTrail()
        autocmd! ColorScheme * if g:colors_name == "solarized" | call s:SolarizedHiTrail() | else | augroup! s:SolarizedHiTrail | endif
    endif
augroup END

My hypothesis is that end of this line:

syn match solarizedTrailingSpace "\s*$"

Needs to be \s\+$ instead (matching only if there really is whitespace).

jtratner commented 11 years ago

also @morganprecision thank you very much for taking the time to narrow it down to such an extent - I really appreciate it! Makes it much easier for me to figure out what's wrong.