Skip to content

Commit

Permalink
Show controller related to view at the top of the list
Browse files Browse the repository at this point in the history
  • Loading branch information
noklesta committed Jul 8, 2012
1 parent 5b17efa commit 05fd399
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions SublimeRailsNav.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ def construct_related_file_name_pattern(self, current_file):
pattern = re.sub(self.MODEL_DIR, self.CONTROLLER_DIR, current_file)
pattern = re.sub(r'\w+(\.\w+)$', '%s_controller\g<1>' % plural, pattern)
return pattern
elif self.VIEW_DIR in current_file:
pattern = re.sub(self.VIEW_DIR, self.CONTROLLER_DIR, current_file)
pattern = re.sub(os.path.join('', r'(\w+)', r'[\w\.]+$'), '\g<1>_controller', pattern)
return pattern
elif self.controller_test_dir in current_file:
pattern = re.sub(self.controller_test_dir, self.CONTROLLER_DIR, current_file)
pattern = re.sub(r'(\_%s)(.\w+)$' % self.test_type, '\g<2>', pattern)
Expand Down

0 comments on commit 05fd399

Please sign in to comment.