lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Has anyone fixed the vim syntax highlighting for [[...]] strings?
The version of lua.vim available at our tools page (which has recently moved
to lua-users) does not handle nested comments, as in
	return [[ alpha [[ beta ]] gamma ]] 

I think I fixed this as follows, but I know little of vim syntax highlighting.

 60c61
 < syn region  luaString	start=+\[\[+ end=+\]\]+ 
 ---
 > syn region  luaString2	start=+\[\[+ end=+\]\]+ contains=luaString2
 103a105
 >   hi link luaString2		String

Does anyone out there knows whether this is the correct or better way?

Also, we're considering adding block comments to Lua in the form --[[...]],
as suggested in lua-users (there's even a patch available there). We would
like that this form could be highlighted correctly in vim and other editors,
even when the --[[...]] contains [[..]] strings and other --[[...]] comments.
We'd like to know whether highlighting --[[...]] comments is possible/easy
to do in vim and other editors. Please let us know. Thanks.

--lhf