dominikh / go-mode.el

Emacs mode for the Go programming language
BSD 3-Clause "New" or "Revised" License
1.38k stars 211 forks source link

Improve go-fontify-variables logic. #368

Closed muirdm closed 4 years ago

muirdm commented 4 years ago

Previously when go-fontify-variables was nil we would avoid fontifying variables by swapping in the "default" face instead of "font-lock-variable-name-face". This worked, but recently I've noticed it had unintended side effects. Namely it doesn't play well when other modes (such as vc diff) add overlay faces. The "default" font lock face overrides the overlay background, so your Go variables look bad in vc diff buffers.

Fix by instead zeroing out the relevant match data so nothing gets font locked at all.

psanford commented 4 years ago

:+1: