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

Commit 6411ed1

Browse files
committed
Merge remote-tracking branch 'origin/develop-9.0' into merge-develop_9.0-24.07.18
2 parents 46cfa95 + 46297e0 commit 6411ed1

File tree

6 files changed

+44
-32
lines changed

6 files changed

+44
-32
lines changed

Toolset/palettes/message box/behaviors/revmessageboxsinglelinemessagebehavior.livecodescript

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,16 @@ command revDisplayAutoComplete pString
105105
put empty into field "auto complete"
106106
end if
107107
cancel sColorizeAutocompleteMsg
108-
get the long id of field "auto complete"
109-
send "revSEColorizeField it" to stack "revSEUtilities" in 100 milliseconds
108+
send "__ColorizeAutocomplete" to me in 100 milliseconds
110109
put the result into sColorizeAutocompleteMsg
111-
set the textColor of char 1 to -1 of field "auto complete" to "gray70"
112110
unlock screen
113111
end revDisplayAutoComplete
114112

113+
on __ColorizeAutocomplete
114+
dispatch "revSEColorizeField" to stack "revSEUtilities" with the long id of field "auto complete"
115+
set the textColor of char 1 to -1 of field "auto complete" to "gray70"
116+
end __ColorizeAutocomplete
117+
115118
command revNextLine
116119
lock messages
117120
if field "auto complete" is empty then

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

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ end textReplaceRawInVariable
10181018
# This is the raw replacement operation that performs a mutation on the script field without
10191019
# saving any undo information. This should be called only from inside textReplace, when doing an undo or a redo
10201020
# and when setting the script when a new object is loaded.
1021-
private command textReplaceRaw pOffset, @pOldText, @pNewText, pDontUpdateBreakpoints
1021+
private command textReplaceRaw pOffset, @pOldText, @pNewText, pDontUpdateBreakpoints, pUpdateBreakpointsNow
10221022
lock screen
10231023
lock messages
10241024

@@ -1044,15 +1044,14 @@ private command textReplaceRaw pOffset, @pOldText, @pNewText, pDontUpdateBreakpo
10441044
add 1 to tNewLines
10451045
end if
10461046
end if
1047+
unlock messages
10471048

10481049
if pDontUpdateBreakpoints then
1049-
updateGutterRequest empty, empty, tOldLines, tNewLines, false, false
1050+
updateGutterRequest empty, empty, tOldLines, tNewLines, false, false, false, pUpdateBreakpointsNow
10501051
else
1051-
updateGutterRequest pOffset, tSelectedLine, tOldLines, tNewLines, true, false
1052+
updateGutterRequest pOffset, tSelectedLine, tOldLines, tNewLines, true, false, false, pUpdateBreakpointsNow
10521053
end if
10531054

1054-
unlock messages
1055-
10561055
# OK-2008-09-10 : Bug 7132 - Update the panes and handler list everytime the text of the field is changed.
10571056
# OK-2009-01-19 : Don't do this here as it slows down the script editor on OS X. Instead do it in the individual
10581057
# cases where it may be needed, cut, paste, return, delete, backspace, undo and redo
@@ -1086,12 +1085,13 @@ on textUndo
10861085

10871086
local tOperations
10881087
put sTextGroupLengths[sObjectId,sTextGroupIndex[sObjectId]] into tOperations
1088+
10891089
lock screen
10901090
repeat with tIndex = sTextOperationIndex[sObjectId] down to sTextOperationIndex[sObjectId] - tOperations + 1
10911091
local tNewText, tOldText
10921092
put sTextOperationNewTexts[sObjectId,tIndex] into tNewText
10931093
put sTextOperationOldTexts[sObjectId,tIndex] into tOldText
1094-
textReplaceRaw sTextOperationOffsets[sObjectId,tIndex], tNewText, tOldText
1094+
textReplaceRaw sTextOperationOffsets[sObjectId,tIndex], tNewText, tOldText, false, true
10951095
end repeat
10961096
unlock screen
10971097

@@ -1123,7 +1123,7 @@ on textRedo
11231123
local tNewText, tOldText
11241124
put sTextOperationOldTexts[sObjectId,tIndex] into tOldText
11251125
put sTextOperationNewTexts[sObjectId,tIndex] into tNewText
1126-
textReplaceRaw sTextOperationOffsets[sObjectId,tIndex], tOldText, tNewText
1126+
textReplaceRaw sTextOperationOffsets[sObjectId,tIndex], tOldText, tNewText, false, true
11271127
end repeat
11281128
unlock screen
11291129

@@ -1235,6 +1235,12 @@ end getUpdateGutterRequestDetails
12351235
# mutable objects (the breakpoint / compilation error images). These are show again when the update is
12361236
# actually carried out.
12371237
command updateGutterRequest pOffset, pSelectedLine, pOldLines, pNewLines, pTextChanged, pUpdateCompilationErrors, pForceBreakpointRedraw, pNow
1238+
if sGutterUpdateRequestDetails["offset"] is not empty and \
1239+
pOffset is not sGutterUpdateRequestDetails["offset"] then
1240+
-- if the offset is different we can't merge
1241+
updateGutterDo
1242+
end if
1243+
12381244
updateGutterMergeRequestDetails pOffset, pSelectedLine, pOldLines, pNewLines, pTextChanged, pUpdateCompilationErrors, pForceBreakpointRedraw
12391245
if sGutterUpdateRequest is not empty then
12401246
cancel sGutterUpdateRequest
@@ -1248,7 +1254,7 @@ command updateGutterRequest pOffset, pSelectedLine, pOldLines, pNewLines, pTextC
12481254
set the vScroll of field "Numbers" of group "Gutter" to the vScroll of field "Script" of me
12491255
end if
12501256

1251-
if pNow then
1257+
if pNow or (pOldLines is not 1 or pNewLines is not 1) then
12521258
updateGutterDo
12531259
else
12541260
send "updateGutterDo" to me in 200 milliseconds
@@ -2071,7 +2077,7 @@ on scrollBarDrag
20712077
lock screen
20722078
put tVScroll into sVScroll
20732079

2074-
updateGutterRequest empty, empty, empty, empty, false, true, empty, true
2080+
updateGutterRequest empty, empty, empty, empty, false, true, false, true
20752081
unlock screen
20762082
end scrollBarDrag
20772083

@@ -2878,7 +2884,7 @@ command scriptComment
28782884
delete the last char of tCommentedText
28792885

28802886
# Apply the mutation to the field
2881-
textMark "Insert"
2887+
textBeginGroup "Comment"
28822888
textReplace tStartChar, tText, tCommentedText
28832889

28842890
# Restore the selection
@@ -2891,8 +2897,9 @@ command scriptComment
28912897
put __GetPreference("editor,autoformat", true) into tAutoFormat
28922898

28932899
if tAutoFormat then
2894-
scriptFormat "handler"
2900+
scriptFormat "handler", true
28952901
end if
2902+
textEndGroup
28962903

28972904
unlock screen
28982905
end scriptComment
@@ -2941,7 +2948,7 @@ command scriptUncomment
29412948
delete the last char of tUncommentedText
29422949

29432950
# Apply the mutation to the field
2944-
textMark "Insert"
2951+
textBeginGroup "Uncomment"
29452952
textReplace tStartChar, tText, tUncommentedText
29462953

29472954
# Restore the selection
@@ -2954,8 +2961,9 @@ command scriptUncomment
29542961
put __GetPreference("editor,autoformat", true) into tAutoFormat
29552962

29562963
if tAutoFormat then
2957-
scriptFormat "handler"
2964+
scriptFormat "handler", true
29582965
end if
2966+
textEndGroup
29592967

29602968
unlock screen
29612969
end scriptUncomment

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ command update pOffset, pSelectedLine, pOldNumber, pNewNumber, pTextChanged, pUp
5454
put tContext["object"] into sLastObject
5555
end if
5656

57-
updateBreakpoints pOffset, pSelectedLine, pOldNumber, pNewNumber, pTextChanged, tContext
57+
updateBreakpoints pOffset, pOldNumber, pNewNumber, pTextChanged, tContext
5858
updateLineNumbers pTextChanged, pOldNumber, pNewNumber, tContext
5959
updateCurrentLine tContext
6060

@@ -390,12 +390,12 @@ end updateCompilationErrors
390390

391391
# Parameters
392392
# pObject : reference to the object to update breakpoint positions for
393-
# pLine : the current line number
393+
# pOffset : the offset of text replacement
394394
# pOldNumber : the number of lines previously in the script
395395
# pNewNumber : the number of lines now in the script
396396
# Description
397397
# Updates the the positions of breakpoints in response to the script being changed.
398-
private command updateBreakpointPositions pObject, pOffset, pLine, pOldNumber, pNewNumber
398+
private command updateBreakpointPositions pObject, pOffset, pOldNumber, pNewNumber
399399
local tNumber, tInsertion
400400

401401
if pOldNumber = pNewNumber then
@@ -405,12 +405,12 @@ private command updateBreakpointPositions pObject, pOffset, pLine, pOldNumber, p
405405
local tBreakpoints
406406
put revDebuggerListBreakpoints(pObject) into tBreakpoints
407407

408+
local tLineIndex
409+
put the lineIndex of char pOffset of getScriptField() into tLineIndex
410+
408411
if pOldNumber < pNewNumber then
409412
repeat for each line tBreakpoint in tBreakpoints
410-
if item -1 of tBreakpoint = pLine then
411-
local tLineIndex
412-
put the lineIndex of char pOffset of getScriptField() into tLineIndex
413-
413+
if item -1 of tBreakpoint = tLineIndex then
414414
local tCharIndex
415415
put the charIndex of line tLineIndex of getScriptField() into tCharIndex
416416

@@ -428,31 +428,31 @@ private command updateBreakpointPositions pObject, pOffset, pLine, pOldNumber, p
428428
end if
429429

430430
# If the line that contained the breakpoint was above the added text, leave it where it is
431-
if item -1 of tBreakpoint < pLine then
431+
if item -1 of tBreakpoint < tLineIndex then
432432
next repeat
433433
end if
434434

435435

436436
# If the line that contained the breakpoint was below the added text, move the breakpoint down by the number of lines added.
437-
if item -1 of tBreakpoint > pLine then
437+
if item -1 of tBreakpoint > tLineIndex then
438438
revDebuggerMoveBreakpoint item 1 to -2 of tBreakpoint, item -1 of tBreakpoint, item 1 to -2 of tBreakpoint, item -1 of tBreakpoint + (pNewNumber - pOldNumber)
439439
end if
440440
end repeat
441441
else
442442
local tScript
443443
put textGetScript() into tScript
444444
repeat for each line tBreakpoint in tBreakpoints
445-
if (item -1 of tBreakpoint >= pLine and item -1 of tBreakpoint < (pLine - (pNewNumber - pOldNumber))) and revDebuggerNextAvailableBreakpoint(tScript, item -1 of tBreakpoint - 1 + (pNewNumber - pOldNumber)) <> item -1 of tBreakpoint + (pNewNumber - pOldNumber) then
445+
if (item -1 of tBreakpoint >= tLineIndex and item -1 of tBreakpoint < (tLineIndex - (pNewNumber - pOldNumber))) and revDebuggerNextAvailableBreakpoint(tScript, item -1 of tBreakpoint - 1 + (pNewNumber - pOldNumber)) <> item -1 of tBreakpoint + (pNewNumber - pOldNumber) then
446446
revDebuggerRemoveBreakpoint item 1 to -2 of tBreakpoint, item -1 of tBreakpoint
447-
else if item -1 of tBreakpoint > (pLine + pNewNumber - pOldNumber) then
447+
else if item -1 of tBreakpoint > (tLineIndex + pNewNumber - pOldNumber) then
448448
# If the breakpoint was below the removed lines, move it up
449449
revDebuggerMoveBreakpoint item 1 to -2 of tBreakpoint, item -1 of tBreakpoint, item 1 to -2 of tBreakpoint, item -1 of tBreakpoint + (pNewNumber - pOldNumber)
450450
end if
451451
end repeat
452452
end if
453453
end updateBreakpointPositions
454454

455-
private command updateBreakpoints pOffset, pSelectedLine, pOldNumber, pNewNumber, pTextChanged, pContext
455+
private command updateBreakpoints pOffset, pOldNumber, pNewNumber, pTextChanged, pContext
456456
clearMutableObjects
457457

458458
local tObject
@@ -468,7 +468,7 @@ private command updateBreakpoints pOffset, pSelectedLine, pOldNumber, pNewNumber
468468
end if
469469

470470
if pTextChanged then
471-
updateBreakpointPositions tObject, pOffset, pSelectedLine, pOldNumber, pNewNumber
471+
updateBreakpointPositions tObject, pOffset, pOldNumber, pNewNumber
472472
end if
473473

474474
# Get a list of the breakpoints set on the current object using revDebuggerListBreakpoints.
@@ -717,7 +717,7 @@ on gutterMouseUp pTarget, pClickLoc
717717

718718
lock screen
719719
clearMutableObjects
720-
updateBreakpoints 1, 1, 1, 1, false
720+
updateBreakpoints 1, 1, 1, false
721721
# OK-2010-02-26: Avoid delays when updating breakpoints by only updating the breakpoints pane
722722
-- sePanesUpdate
723723
seRefreshCurrentPaneIfItsBreakpoints
@@ -757,7 +757,7 @@ on menuPick pItemName
757757

758758
lock screen
759759
clearMutableObjects
760-
updateBreakpoints 1, 1, 1, 1, false
760+
updateBreakpoints 1, 1, 1, false
761761

762762
# OK-2010-02-26: Avoid delays when updating breakpoints by only updating the breakpoints pane
763763
-- sePanesUpdate
-169 Bytes
Binary file not shown.

Toolset/palettes/standalone settings/revstandalonesettingsandroidbehavior.livecodescript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ on updateSettings
4040

4141
--put computeDefault(tSettings["android,label"], tSettings["name"]) into field "Label"
4242

43-
set the unicodeText of field "Label" to uniEncode(computeDefault(tSettings["android,label"], tSettings["name"]), "UTF8")
43+
set the text of field "Label" to computeDefault(tSettings["android,label"], tSettings["name"])
4444

4545
put computeDefault(tSettings["android,identifier"], "com.yourcompany.yourapp") into field "Identifier"
4646
put computeDefault(tSettings["android,version name"], "1.0.0") into field "Version Name"

notes/bugfix-21232.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Fix wandering breakpoints when undoing paste

0 commit comments

Comments
 (0)