Skip to content

Commit

Permalink
$folder was missing in _subst_for_translate when no view was active
Browse files Browse the repository at this point in the history
fix #202
  • Loading branch information
wuub committed Jul 10, 2013
1 parent ab020c6 commit 4d5c9b0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sublimerepl.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,8 @@ def _subst_for_translate(window):
"packages": sublime.packages_path(),
"installed_packages": sublime.installed_packages_path()
}
if window.folders():
res["folder"] = window.folders()[0]
res["editor"] = "subl -w"
res["win_cmd_encoding"] = "utf8"
if sublime.platform() == "windows":
Expand All @@ -526,9 +528,7 @@ def _subst_for_translate(window):
res["file"] = filename
res["file_path"] = os.path.dirname(filename)
res["file_basename"] = os.path.basename(filename)
if window.folders():
res["folder"] = window.folders()[0]
else:
if 'folder' not in res:
res["folder"] = res["file_path"]

if sublime.load_settings(SETTINGS_FILE).get("use_build_system_hack", False):
Expand Down

0 comments on commit 4d5c9b0

Please sign in to comment.