Skip to content

Commit

Permalink
Address some sublime2 compatibility issues found by @ariswang92
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-kane committed May 10, 2021
1 parent 343df2e commit 201575f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions PyYapf.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,13 @@ def find_yapf(self):
# default to what is in the settings file
cmd = self.get_setting("yapf_command")
cmd = os.path.expanduser(cmd)
cmd = sublime.expand_variables(
cmd,
sublime.active_window().extract_variables()
)

# sublime 2.x support per https://github.com/jason-kane/PyYapf/issues/53
if hasattr(sublime, "expand_variables"):
cmd = sublime.expand_variables(
cmd,
sublime.active_window().extract_variables()
)

save_settings = not cmd

Expand Down
2 changes: 1 addition & 1 deletion PyYapf.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"on_save": false,

// ignore files matching glob(s)
"onsave_ignore_fn_glob": ["*.pyx", ],
"onsave_ignore_fn_glob": ["*.pyx"],

// report errors in popup dialog (in addition to status bar)
"popup_errors": false,
Expand Down

0 comments on commit 201575f

Please sign in to comment.