Sublime-CoolFormat icon indicating copy to clipboard operation
Sublime-CoolFormat copied to clipboard

CoolFormat deletes text if syntax does not match any presets.

Open Enteleform opened this issue 9 years ago • 1 comments

If you attempt to run CoolFormat on a file whose syntax does not match any of the supported languages, all text in the document will be deleted.

  This can easily be resolved by implementing a simple verification process:

  • activeSyntax = view.settings().get( "syntax" )
  • check the found syntax against an array of valid syntaxes
  • return if no matches are found

Enteleform avatar Apr 15 '16 22:04 Enteleform

Fixed it in https://github.com/akof1314/Sublime-CoolFormat/commit/837c83b775de2b0bf83ae278dcfba92505780dcb

akof1314 avatar Apr 27 '16 02:04 akof1314