Skip to content

Commit

Permalink
now config-path is default set to project file directory if any ot be…
Browse files Browse the repository at this point in the history
…ing edited file directory
  • Loading branch information
DamnWidget committed Jul 4, 2016
1 parent 08a52f8 commit 53da526
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
9 changes: 4 additions & 5 deletions commands/rustfmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,11 @@ def clean_tmp_file(self, path):
pass

def _get_working_directory(self):
"""Return back the project directory if any or the file one
"""Return back the project file directory if any or current file one
"""

project_data = sublime.active_window().project_data()
if project_data is not None:
if len(project_data['folders']) > 0:
return project_data['folders'][0]['path']
pfilename = sublime.active_window().project_file_name()
if pfilename is not None:
return os.path.dirname(pfilename)

return os.path.dirname(self.view.file_name())
3 changes: 2 additions & 1 deletion messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"0.1.3": "messages/0.1.3.txt",
"0.2.0": "messages/0.2.0.txt",
"0.2.1": "messages/0.2.1.txt",
"0.2.2": "messages/0.2.2.txt"
"0.2.2": "messages/0.2.2.txt",
"0.2.3": "messages/0.2.3.txt"
}
6 changes: 6 additions & 0 deletions messages/0.2.3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Changes in 0.2.3
================

## Changes
- Now config_path is set to the project file directory if any or the being
edited diretory if is not manually set by the user.

0 comments on commit 53da526

Please sign in to comment.