-
-
Save artbear/6617368da48813ce81ab to your computer and use it in GitHub Desktop.
auto save as utf-8-bom in atom for onescript-files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
atom.workspace.observeTextEditors (editor) -> | |
editor.onDidSave -> | |
if editor.getPath().slice(-3) is '.os' | |
if editor.getEncoding() is 'utf8' and editor.getText().charCodeAt(0) isnt 65279 | |
editor.setText String.fromCharCode(65279) + editor.getText() | |
editor.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment