Skip to content

Commit

Permalink
Allow jumping to root files from anywhere
Browse files Browse the repository at this point in the history
Fixes #63
  • Loading branch information
mrjoelkemp committed Dec 11, 2014
1 parent 59ac5a3 commit 2f7c258
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 1 addition & 3 deletions JumpToDependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ def run(self):
self.view = self.window.active_view()
self.view.filename = self.view.file_name()
self.view.path = base_path
# Needed for resolving relative paths
self.view.pathWithinRoot = self.view.filename[self.view.filename.index(self.window.root) + len(self.window.root):]

if not met(self.view.path):
return
Expand Down Expand Up @@ -133,7 +131,7 @@ def get_selected_module_region(self):

def handleRelativePaths(self, module):
if (module.find('..') == 0 or module.find('.') == 0):
fileDir = os.path.dirname(self.view.pathWithinRoot)
fileDir = os.path.dirname(self.view.filename)
module = os.path.normpath(os.path.join(fileDir, module))

if (module[0] == '/'):
Expand Down
7 changes: 7 additions & 0 deletions changelogs/2.0.3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Bug fix: Jump to a module from any file (inside or outside the root)
---

If you have a test file that depends on a module within the root,
you can jump to that dependency from the test file.

Ping me for any issues: @mrjoelkemp. Thanks for using the plugin!
3 changes: 2 additions & 1 deletion messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@
"1.9.0": "changelogs/1.9.0.txt",
"2.0.0": "changelogs/2.0.0.txt",
"2.0.1": "changelogs/2.0.1.txt",
"2.0.2": "changelogs/2.0.2.txt"
"2.0.2": "changelogs/2.0.2.txt",
"2.0.3": "changelogs/2.0.3.txt"
}

0 comments on commit 2f7c258

Please sign in to comment.