Skip to content

Commit 0fb4bee

Browse files
committed
Settings: Don't use os.path for resource paths
1 parent abc07dc commit 0fb4bee

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

plugins_/settings/known_settings.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import weakref
88

99
import sublime
10-
from sublime_lib import encodings
10+
from sublime_lib import encodings, ResourcePath
1111

1212

1313
from ..lib.weakmethod import WeakMethodProxy
@@ -743,10 +743,9 @@ def _theme_completions(default):
743743
"""
744744
hidden = get_setting('settings.exclude_theme_patterns') or []
745745
completions = set()
746-
for theme in sublime.find_resources("*.sublime-theme"):
747-
theme = os.path.basename(theme)
748-
if not any(hide in theme for hide in hidden):
746+
for theme_path in ResourcePath.glob_resources("*.sublime-theme"):
747+
if not any(hide in theme_path.name for hide in hidden):
749748
completions.add(format_completion_item(
750-
value=theme, default=default, description="theme"
749+
value=theme_path.name, default=default, description="theme"
751750
))
752751
return completions

0 commit comments

Comments
 (0)