Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 6fceb0f

Browse files
committed
[[ Tools ]] Tidy up tools palette preference handling
1 parent b703e7a commit 6fceb0f

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

Toolset/palettes/tools/revtools.livecodescript

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,17 @@ on framePreferenceSelected pPreference, pValue
138138
revIDESetPreference "revTools_columns", pValue
139139
break
140140
case "revTools_show"
141-
local tCurrentPreferenceValue, tPreferencePosition
141+
local tCurrentPreferenceValue, tPreferencePosition, tLineOffset
142142
put revIDEGetPreference("revTools_show") into tCurrentPreferenceValue
143-
if pValue is among the items of tCurrentPreferenceValue then
144-
repeat with x = the number of items of tCurrentPreferenceValue down to 1
145-
if item x of tCurrentPreferenceValue is pValue then
146-
delete item x of tCurrentPreferenceValue
147-
end if
148-
end repeat
143+
put lineOffset(pValue, tCurrentPreferenceValue) into tLineOffset
144+
if tLineOffset is not 0 then
145+
delete line tLineOffset of tCurrentPreferenceValue
149146
else
150-
put "," & pValue after tCurrentPreferenceValue
147+
if tCurrentPreferenceValue is empty then
148+
put pValue into tCurrentPreferenceValue
149+
else
150+
put comma & pValue after tCurrentPreferenceValue
151+
end if
151152
end if
152153
revIDESetPreference "revTools_show", tCurrentPreferenceValue
153154
break

0 commit comments

Comments
 (0)