tpope / vim-cucumber

Vim Cucumber runtime files
http://www.vim.org/scripts/script.php?script_id=2973
324 stars 63 forks source link

syntax highlighting broken with multiple scenario keywords #13

Closed claw111 closed 12 years ago

claw111 commented 12 years ago

I'm using vim 7.3 and installed the latest vim-cucumber as a pathogen bundle from master. I started editing a feature file which had multiple scenarios and noticed that the syntax highlighting for the second and subsequent "Scenario" keywords only had the "S" from "Scenario" highlighted. The first "Scenario" keyword was correctly highlighted.

tpope commented 12 years ago

What do :set encoding? and :set fileencoding? report back?

claw111 commented 12 years ago

encoding=latin1 fileencoding=

I have since tried another OS with the same vim version and pathogen bundle. I suspect this might not be an issue with the vim-cucumber code per-se, but rather with the old OS release I'm running.

Sorry for the red-herring. :)

tpope commented 12 years ago

The encoding can cause it. I can't remember the specifics but some fancy UTF-8 foreign language version of the word "Scenario" matches as "S" in a latin1 encoding. A workaround should be to add a # language: en header to the file, which let's cucumber.vim (and cucumber itself) know that English is the preferred language for that file.

tpope commented 12 years ago

Oh, and a better workaround is just :set encoding=utf-8 in your vimrc.