tidalcycles / vim-tidal

Vim plugin for TidalCycles
MIT License
223 stars 56 forks source link

"#" red highlighting #24

Closed ovitus closed 5 years ago

ovitus commented 5 years ago

Why is it that the hash symbol (#) causes the line to be highlighted red? This only happens with .tidal files. red

munshkr commented 5 years ago

I've seen this before. Apparently, the default syntax highlighting that Vim provides for Haskell files does not like lines starting with the # operator (even if it's valid Haskell in this case). As a workaround, you can try installing this third party plugin for Haskell. If you're using Plug, add this to your .vimrc (in your plugins section):

Plug 'neovimhaskell/haskell-vim'

Then restart Vim and call :PlugInstall. This fixes the red highlighting problem.

I'll keep this issue open so I can figure out what's causing it and patch it here.

munshkr commented 5 years ago

I've fixed this by including the haskell syntax file as "tidal" syntax file. Also fixed how it highlighted new lines starting with a #, as they were highlighted as Haskell preprocessing macros:

screenshot_2018-11-24_09-51-35

You can just upgrade the plugin with :PlugUpdate to get the latest fix.

ovitus commented 5 years ago

I updated, highlights are gone, but nothing works when I use the hash below the primary pattern, it has no effect. For instance:

d1 $ n "[-3 6 1] 4" # s "midi" # sustain "0.1"

will sustain notes 0.1

d1 $ n "[-3 6 1] 4" # s "midi"
# sustain "0.1"

sustain ignored