Skip to content

Commit

Permalink
Auto-migrate existing .tags_sorted_file to .tags
Browse files Browse the repository at this point in the history
Needed to migrate existing sorted .tags files to new name
as it is changed by PR #349.
  • Loading branch information
deathaxe committed Jan 6, 2024
1 parent e20f027 commit babb1a9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ctagsplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,17 @@ def run(self, view, args, tags_file):

files = [key]

# Note: Help migrating existing tags files to new file name.
# Needed, because this plugin now sorts .tags file in-place,
# while former versions used to create a dedicated file.
sorted_tags_file = tags_file + '_sorted_by_file'
if os.path.isfile(sorted_tags_file):
try:
os.remove(tags_file)
os.rename(sorted_tags_file, tags_file)
except OSError:
pass

base_path = get_common_ancestor_folder(
view.file_name(), view.window().folders())

Expand Down

0 comments on commit babb1a9

Please sign in to comment.