Skip to content

Commit

Permalink
Settings: Don't use os.path for resource paths
Browse files Browse the repository at this point in the history
  • Loading branch information
FichteFoll committed Sep 20, 2019
1 parent abc07dc commit 0fb4bee
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions plugins_/settings/known_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import weakref

import sublime
from sublime_lib import encodings
from sublime_lib import encodings, ResourcePath


from ..lib.weakmethod import WeakMethodProxy
Expand Down Expand Up @@ -743,10 +743,9 @@ def _theme_completions(default):
"""
hidden = get_setting('settings.exclude_theme_patterns') or []
completions = set()
for theme in sublime.find_resources("*.sublime-theme"):
theme = os.path.basename(theme)
if not any(hide in theme for hide in hidden):
for theme_path in ResourcePath.glob_resources("*.sublime-theme"):
if not any(hide in theme_path.name for hide in hidden):
completions.add(format_completion_item(
value=theme, default=default, description="theme"
value=theme_path.name, default=default, description="theme"
))
return completions

0 comments on commit 0fb4bee

Please sign in to comment.