Permalink
Browse files

Revert "Close #47 PR: Force whitespace pre-save. Fixes #33"

This reverts commit 1912349.
1 parent 1912349 commit 07b889699b744ec4b134ac74d5e4878cd3a4f585 @sindresorhus committed Jul 26, 2015
Showing with 2 additions and 5 deletions.
  1. +2 −5 EditorConfig.py
View
@@ -1,5 +1,4 @@
import pprint
-import sublime
import sublime_plugin
def unexpanduser(path):
@@ -71,16 +70,14 @@ def apply_pre_save(self, view, config):
charset = config.get('charset')
end_of_line = config.get('end_of_line')
indent_style = config.get('indent_style')
- position = view.viewport_position()
if charset in CHARSETS:
view.set_encoding(CHARSETS[charset])
if end_of_line in LINE_ENDINGS:
view.set_line_endings(LINE_ENDINGS[end_of_line])
- if indent_style == 'space':
+ if indent_style == 'space' and spaces == False:
view.run_command('expand_tabs', {'set_translate_tabs': True})
- elif indent_style == 'tab':
+ elif indent_style == 'tab' and spaces == True:
view.run_command('unexpand_tabs', {'set_translate_tabs': True})
- view.set_viewport_position(position)
def apply_config(self, view, config):
settings = view.settings()

0 comments on commit 07b8896

Please sign in to comment.