Skip to content

Commit

Permalink
Check for user selection for preview to remove any potential flicker
Browse files Browse the repository at this point in the history
  • Loading branch information
benweier committed Aug 5, 2013
1 parent f8713ef commit d10c1f4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion schemr.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@ def on_done(index):
if index == -1:
self.set('color_scheme', the_scheme)

self.user_selected = False
def on_select(index):
self.set('color_scheme', color_schemes[index][1])
if self.user_selected == True:
self.set('color_scheme', color_schemes[index][1])
else:
self.user_selected = True

try: # Attempt to enable preview-on-selection (only supported by Sublime Text 3).
window.show_quick_panel(color_schemes, on_done, 0, the_index, on_select)
Expand Down

0 comments on commit d10c1f4

Please sign in to comment.