Skip to content

Commit

Permalink
Show views related to controller 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 e8b1af1 commit 5b17efa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions SublimeRailsNav.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,14 @@ def run(self):
return
self.show_files([['app', 'views']], '\.(?:erb|haml|slim)$')

def construct_related_file_name_pattern(self, current_file):
if self.CONTROLLER_DIR in current_file:
pattern = re.sub(self.CONTROLLER_DIR, self.VIEW_DIR, current_file)
pattern = re.sub(r'(\w+)_controller\.\w+$', '\g<1>' + os.sep, pattern)
return pattern
else:
return None

def is_listing_current_file_group(self, current_file):
return 'app/views' in current_file

Expand Down

0 comments on commit 5b17efa

Please sign in to comment.