Skip to content

Commit

Permalink
Merge pull request wistful#10 from enricobacis/master
Browse files Browse the repository at this point in the history
Fixed the shortcuts descriptions
  • Loading branch information
Mikhail committed Nov 17, 2012
2 parents 7139535 + 3b2e5b8 commit b204db4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Readme.md
Expand Up @@ -24,8 +24,8 @@ Once you install Package Control, restart ST2 and bring up the Command Palette (

AutoPEP8 runs in one of two modes:

+ **AutoPep8 Format** (`Command/Control+Shift+F8`) - automatically formats code
+ **AutoPep8 Preview** (`Command/Control+F8`) - open new tab to preview changes
+ **AutoPep8 Format** (`Command/Control + Shift + 8`) - automatically formats code
+ **AutoPep8 Preview** (`Command/Control + 8`) - open new tab to preview changes

You can also select mode by mouse right click.

4 changes: 2 additions & 2 deletions messages/install.txt
Expand Up @@ -12,7 +12,7 @@ Features:

AutoPEP8 runs in one of two modes:

AutoPep8 Format (Command/Control+Shift+F8) - automatically formats code
AutoPep8 Preview (Command/Control+F8) - open new tab to preview changes
AutoPep8 Format (Command/Control + Shift + 8) - automatically formats code
AutoPep8 Preview (Command/Control + 8) - open new tab to preview changes

You can also select mode by mouse right click.
18 changes: 11 additions & 7 deletions sublautopep8.py
Expand Up @@ -128,8 +128,10 @@ def run(self, edit, preview=True):
(0.0, 0.0)) # magic, next line doesn't work without it
self.view.set_viewport_position(vector)

if not has_changes:
sublime.message_dialog("0 issues to fix")
if has_changes:
sublime.status_message('AutoPEP8: Issues fixed')
else:
sublime.status_message('AutoPEP8: No issues to fix')

def is_visible(self, *args):
return self.view.settings().get('syntax') == "Packages/Python/Python.tmLanguage"
Expand Down Expand Up @@ -183,11 +185,13 @@ def run(self, paths=None, preview=True):
else:
preview_output += out_data.decode('utf-8')

sublime.status_message("")
if has_changes and preview_output:
self.new_view('utf-8', preview_output)
if not has_changes:
sublime.message_dialog("0 issues to fix")
if has_changes:
if preview_output:
self.new_view('utf-8', preview_output)
else:
sublime.status_message('AutoPEP8: Issues fixed')
else:
sublime.status_message('AutoPEP8: No issues to fix')

def files(self, path):
result = []
Expand Down

0 comments on commit b204db4

Please sign in to comment.