Skip to content

allow changing opts on project settings file (*.sublime-project) #340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions ctagsplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ def find_tags_relative_to(path, tag_file):

return None

def read_opts(view):
# the first one is useful to change opts only on a specific project
# (by adding ctags.opts to a project settings file)
return view.settings().get('ctags.opts') or setting('opts')

def get_alternate_tags_paths(view, tags_file):
"""
Expand Down Expand Up @@ -537,7 +541,7 @@ def on_select(i):
command = setting('command')
recursive = setting('recursive')
tag_file = setting('tag_file')
opts = setting('opts')
opts = read_opts(view)

rebuild_tags = RebuildTags(False)
rebuild_tags.build_ctags(paths, command, tag_file, recursive, opts)
Expand Down Expand Up @@ -822,7 +826,7 @@ def run(self, edit, **args):

command = setting('command')
recursive = setting('recursive')
opts = setting('opts')
opts = read_opts(self.view)
tag_file = setting('tag_file')

if 'dirs' in args and args['dirs']:
Expand Down