Skip to content

Commit a906a78

Browse files
committed
Fixed: Section toggling issues with hotkeys differing only in casing
1 parent 8d1c808 commit a906a78

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

HeckR_Replace.ahk

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ readReplaceIni(configPath, inheritedSettings := "", dependencyBranch := "") {
116116
; Add section replace list
117117
toggleAbleSections[sectionName] := {}
118118
toggleAbleSections[sectionName]["state"] := settings["replace"]["toggleAbleSections"] != "true" || settings["replace"]["enableToggleAbleSectionsOnStart"] == "true" ? "On" : "Off"
119-
toggleAbleSections[sectionName]["hotstrings"] := {}
119+
toggleAbleSections[sectionName]["hotstrings"] := []
120120

121121
; Create a section toggler hotstrings with a preparameterized function
122122
sectionTogglerHotstringModifierPart := ":" . settings["replace"]["modifiers"] . "X:"
@@ -243,7 +243,7 @@ readReplaceIni(configPath, inheritedSettings := "", dependencyBranch := "") {
243243

244244
; Register as a toggleable
245245
if (settings["replace"]["toggleAbleSections"] == "true")
246-
toggleAbleSections[sectionName]["hotstrings"][customHotstring] := replaceValue
246+
toggleAbleSections[sectionName]["hotstrings"].Push({"hotstring": customHotstring, "replaceValue": replaceValue})
247247

248248
; Add replace
249249
Hotstring(customHotstring, replaceValue, customHotstringDefaultState)
@@ -260,8 +260,8 @@ sectionTogglerBase(sectionName) {
260260
global toggleAbleSections
261261
; Toggle replace
262262
toggleAbleSections[sectionName]["state"] := toggleAbleSections[sectionName]["state"] == "Off" ? "On" : "Off"
263-
for customHotstring, replaceValue in toggleAbleSections[sectionName]["hotstrings"] {
264-
Hotstring(customHotstring, replaceValue, toggleAbleSections[sectionName]["state"])
263+
for hotstringIndex, hotstringData in toggleAbleSections[sectionName]["hotstrings"] {
264+
Hotstring(hotstringData["hotstring"], hotstringData["replaceValue"], toggleAbleSections[sectionName]["state"])
265265
}
266266
}
267267

@@ -274,8 +274,8 @@ alternativeDisableBase(alternativeDisableHotstringBase) {
274274
for sectionIndex, sectionName in alternativeSectionDisablers[alternativeDisableHotstringBase]
275275
if (toggleAbleSections[sectionName]["state"] == "On") {
276276
toggleAbleSections[sectionName]["state"] := "Off"
277-
for customHotstring, replaceValue in toggleAbleSections[sectionName]["hotstrings"]
278-
Hotstring(customHotstring, , "Off")
277+
for hotstringIndex, hotstringData in toggleAbleSections[sectionName]["hotstrings"]
278+
Hotstring(hotstringData["hotstring"], , "Off")
279279
}
280280
}
281281

0 commit comments

Comments
 (0)