in reply to Detecting Dangling Commas in JavaScript
(Tried it as a simple :%!perl -pi -e at first, but vim hated the # characters.):command FixCommas perl $s=join(qq{\n},$curbuf->Get(0 .. $curbuf->Coun +t()));$s =~ s#^((?:[^/\n]|/(?!/))*),((?:\s*|//.*$|/\*(?:[^*]|\*(?!/)) +*\*/)*\s*[}\]])#$1$2#mg; $curbuf->Set(0,0,split(qq{\n},$s));
|
|---|