Skip to content

Commit

Permalink
Close #47 PR: Force whitespace pre-save. Fixes #33
Browse files Browse the repository at this point in the history
  • Loading branch information
ktrotter-emsi authored and sindresorhus committed Jul 25, 2015
1 parent beb5fa0 commit 1912349
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions EditorConfig.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pprint
import sublime
import sublime_plugin

def unexpanduser(path):
Expand Down Expand Up @@ -70,14 +71,16 @@ 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' and spaces == False:
if indent_style == 'space':
view.run_command('expand_tabs', {'set_translate_tabs': True})
elif indent_style == 'tab' and spaces == True:
elif indent_style == 'tab':
view.run_command('unexpand_tabs', {'set_translate_tabs': True})
view.set_viewport_position(position)

def apply_config(self, view, config):
settings = view.settings()
Expand Down

4 comments on commit 1912349

@dontbother
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sindresorhus just letting you know this reintroduced the scrolling bug #27

@sindresorhus
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sindresorhus
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm seeing this too. Reverted for now: 07b8896

@kalebtrotter
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sindresorhus Thanks for the heads up and sorry it wasn't fixed -- I still haven't been able to replicate the problem using ST3 on OS X 10.10.3 but I'll have some more time tomorrow afternoon (PST) to try.

Please sign in to comment.