Following up on this question on how to highlight commas not followed by a space; the accepted answer provides a nice solution for problems like:
func(a, b,c,d)
But it also highlights commas at the end of a line (after longname2
):
func(longname1, longname2,
longname3)
There I would actually like to highlight the opposite case, i.e. if there actually was a space behind longname2,
(which is already handled by the highlighting of trailing spaces).
Is there a way to extend/modify this command:
highlight SquishedCommas ctermbg=red guibg=red
match SquishedCommas /, \@!/
To only highlight the SquishedCommas
if they are not at the end of a line?