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

Commit 4442e3f

Browse files
authored
Merge pull request #1879 from montegoulding/sefindenhancements
[[ Bug 20692 & 20736 ]] SE find issues
2 parents 1d4ab86 + 1f7e666 commit 4442e3f

8 files changed

Lines changed: 462 additions & 13 deletions

Toolset/libraries/revidelibrary.8.livecodescript

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5666,6 +5666,8 @@ function revIDEScriptEditorBehavior pWhich
56665666
return tPathToBehaviors & slash & "revseeditbreakpointstackbehavior.livecodescript"
56675667
case "error template"
56685668
return tPathToBehaviors & slash & "revseerrortemplatebehavior.livecodescript"
5669+
case "find main card"
5670+
return tPathToBehaviors & slash & "revsefindmaincardbehavior.livecodescript"
56695671
default
56705672
return empty
56715673
end switch

Toolset/palettes/script editor/behaviors/revseeditorbehavior.livecodescript

Lines changed: 62 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,13 +1045,19 @@ private command prepareContextMenu
10451045
if tMatches is empty then
10461046
put "(" before tGoToDefinition
10471047
end if
1048-
1048+
10491049
local tText
10501050
put tGoToDefinition & return into tText
1051+
put "Find in" & return after tText
1052+
10511053
if not revIDEBrowserWidgetUnavailable() then
1052-
put "Find in Docs" & return after tText
1054+
put tab & "Docs" & return after tText
10531055
end if
10541056

1057+
repeat for each item tItem in \
1058+
"Current Tab,All Tabs,Card,Stack,Stack File,Stack File and its stackFiles,All Stack Files,All available stacks"
1059+
put tab & tItem & return after tText
1060+
end repeat
10551061
put "-" & return after tText
10561062

10571063
put "Set Breakpoint" & return after tText
@@ -1111,7 +1117,9 @@ on menuPick pItemName
11111117
exit menuPick
11121118
end if
11131119

1114-
switch pItemName
1120+
set the itemDelimiter to "|"
1121+
1122+
switch item 1 of pItemName
11151123
case "Set Breakpoint"
11161124
if sLastClickLine is not empty then
11171125
local tScript
@@ -1126,15 +1134,55 @@ on menuPick pItemName
11261134
end if
11271135
break
11281136

1129-
case "Find in Docs"
1130-
local tText, tData
1137+
case "Find in"
1138+
1139+
local tCallback
1140+
put "__FindAllCallback" into tCallback
1141+
1142+
local tCallbackTarget
1143+
put the long id of me into tCallbackTarget
1144+
1145+
local tText
11311146
put getClickText() into tText
1132-
put ideDocsFetchLCSData(tText) into tData
1133-
if tData is not empty then
1134-
revIDEGoToLCSDictionaryEntry tText, tData[1]["type"]
1147+
1148+
local tTarget
1149+
switch item 2 of pItemName
1150+
case "Docs"
1151+
local tData
1152+
put ideDocsFetchLCSData(tText) into tData
1153+
if tData is not empty then
1154+
revIDEGoToLCSDictionaryEntry tText, tData[1]["type"]
1155+
end if
1156+
break
1157+
case "All tabs"
1158+
put "all" into tTarget
1159+
break
1160+
case "Current Tab"
1161+
put "current" into tTarget
1162+
break
1163+
case "Card"
1164+
put "card" into tTarget
1165+
break
1166+
case "Stack"
1167+
put "stack" into tTarget
1168+
break
1169+
case "Stack File"
1170+
put "stack file" into tTarget
1171+
break
1172+
case "All Stack Files"
1173+
put "all stacks" into tTarget
1174+
break
1175+
case "Stack File and its stackFiles"
1176+
put "stack file and stackfiles" into tTarget
1177+
break
1178+
case "All available stacks"
1179+
put "all available stacks" into tTarget
1180+
break
1181+
end switch
1182+
if item 2 of pItemName is not "Docs" then
1183+
send "revSEFindAll tText, false, false, false, true, tTarget, tCallback, tCallbackTarget" to this stack
11351184
end if
11361185
break
1137-
11381186
case "Cut"
11391187
actionCut
11401188
break
@@ -1174,6 +1222,11 @@ on menuPick pItemName
11741222
end switch
11751223
end menuPick
11761224

1225+
on __FindAllCallback pMessage
1226+
wait 0 with messages
1227+
set the cursor to busy
1228+
end __FindAllCallback
1229+
11771230
private command goMatchingDefinition pMatch
11781231
local tObject, tLine
11791232
put item 5 to -1 of pMatch into tObject

0 commit comments

Comments
 (0)