Skip to content

Commit 7c3c93a

Browse files
committed
Reading gutter level preference when executing ShowQuickToggle
1 parent 0ae699c commit 7c3c93a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Editor/QuickToggle.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ private static void UpdateGutterMenu(int gutterLevel)
138138

139139
static QuickToggle()
140140
{
141-
// Setup initial state of editor prefs
141+
// Setup initial state of editor prefs if there are no prefs keys yet
142142
string[] resetPrefs = new string[] {PrefKeyShowToggle, PrefKeyShowDividers, PrefKeyShowIcons};
143143
foreach (string prefKey in resetPrefs)
144144
{
@@ -157,8 +157,9 @@ static QuickToggle()
157157
// Not calling BuildStyles() in constructor because script gets loaded
158158
// on Unity initialization, styles might not be loaded yet
159159

160-
// Reset mouse state and
160+
// Reset mouse state
161161
ResetVars();
162+
// Setup quick toggle
162163
ShowQuickToggle(EditorPrefs.GetBool(PrefKeyShowToggle));
163164
}
164165

@@ -167,6 +168,7 @@ private static void ShowQuickToggle(bool show)
167168
EditorPrefs.SetBool(PrefKeyShowToggle, show);
168169
showDivider = EditorPrefs.GetBool(PrefKeyShowDividers, false);
169170
showIcons = EditorPrefs.GetBool(PrefKeyShowIcons, false);
171+
gutterCount = EditorPrefs.GetInt(PrefKeyGutterLevel);
170172

171173
if (show)
172174
{

0 commit comments

Comments
 (0)