tpope / vim-cucumber

Vim Cucumber runtime files

Home Page:http://www.vim.org/scripts/script.php?script_id=2973

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

syntax highlighting broken with multiple scenario keywords

claw111 opened this issue · comments

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.

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

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. :)

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.

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