From cc7ca4858d7ab4b8e780863632e7e9dde7d2a736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Glauco=20Cust=C3=B3dio?= Date: Thu, 19 Aug 2021 22:32:51 +0100 Subject: [PATCH] allow changing opts on project settings file (*.sublime-project) --- ctagsplugin.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ctagsplugin.py b/ctagsplugin.py index 54fa7f8..c414881 100644 --- a/ctagsplugin.py +++ b/ctagsplugin.py @@ -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): """ @@ -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) @@ -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']: