Latest update

How to highlight function like (req, res, next) -> in javascript/coffee

2018-06-08 05:37:39

gvim 1-26/windows10

I'm trying some .coffee files and meet a lot with this kind of syntax (req, res, next) ->. As I know it's a call back function and I can't get it highlighted.

The reason is that my current regions only be able to capture functions in form of my_function(arg1, arg2=3, arg3), meaning it must contain ( and ).

Note that if arg3 is another function, it's also be nested. So if a call back funciton called like function(arg1, arg2, (req, res, next) -> then arg1, arg2, (req, res, next) highlighted correctly because it contained (, ) and inside of a function that formed with ( and ).

But when (req, res, next) -> not inside a function, it's not highlighted.

I'm thinking of making a lose of my current functioncall region so that it contains * (include empty string)