semantic-highlight.vim icon indicating copy to clipboard operation
semantic-highlight.vim copied to clipboard

:SemanticHightlight does not set b:semanticOn, messes up :SemanticHighlightToggle

Open magv opened this issue 5 years ago • 0 comments

Hi, folks. If you first run :SemanticHightlight to enable the highlight, and then :SemanticHighlightToggle, it will not toggle (as it disable) the highlight. It will do so from the second try though.

This is because :SemanticHightlightToggle relies on b:sematicOn being set to determine if the highlight is on or not, and :SemanticHightlight (being a shortcut for s:semHighlight) does not set it.

I see two solutions here:

  1. Make :SemanticHightlight a shortcut for s:enableHighlight in stead of s:semHighlight, as the former does in fact set b:sematicOn. It seems that s:enableHighlight clears the cache in the addition to setting b:sematicOn, and I don't know if this is desired or not.
  2. Make s:semHighlight set b:sematicOn itself.

magv avatar Jan 10 '20 16:01 magv