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

Commit f51f8d2

Browse files
committed
[[ PERF ]] Delay gutter update when typing
This patch ensures that while typing the editor gutter is delayed to but keeps the immediate update while scrolling. The immediate update while typing was causing a significant slowdown on windows.
1 parent 777afe1 commit f51f8d2

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,7 @@ end getUpdateGutterRequestDetails
12341234
# The gutter's scroll is updated immediately. Also a message is sent to the gutter to hide its
12351235
# mutable objects (the breakpoint / compilation error images). These are show again when the update is
12361236
# actually carried out.
1237-
command updateGutterRequest pOffset, pSelectedLine, pOldLines, pNewLines, pTextChanged, pUpdateCompilationErrors, pForceBreakpointRedraw
1237+
command updateGutterRequest pOffset, pSelectedLine, pOldLines, pNewLines, pTextChanged, pUpdateCompilationErrors, pForceBreakpointRedraw, pNow
12381238
updateGutterMergeRequestDetails pOffset, pSelectedLine, pOldLines, pNewLines, pTextChanged, pUpdateCompilationErrors, pForceBreakpointRedraw
12391239
if sGutterUpdateRequest is not empty then
12401240
cancel sGutterUpdateRequest
@@ -1247,11 +1247,13 @@ command updateGutterRequest pOffset, pSelectedLine, pOldLines, pNewLines, pTextC
12471247
if exists(field "Numbers" of group "Gutter") then
12481248
set the vScroll of field "Numbers" of group "Gutter" to the vScroll of field "Script" of me
12491249
end if
1250-
# BUGFIX-20140
1251-
# 2017-JUL-28 bhall2001 Due to blocking nature of scrolling and key presses, don't send in time.
1252-
# UI effect is Gutter lags behind scrolling of Script Editor
1253-
updateGutterDo
1254-
put the result into sGutterUpdateRequest
1250+
1251+
if pNow then
1252+
updateGutterDo
1253+
else
1254+
send "updateGutterDo" to me in 200 milliseconds
1255+
put the result into sGutterUpdateRequest
1256+
end if
12551257
end updateGutterRequest
12561258

12571259
# update gutter stubs
@@ -2070,7 +2072,7 @@ on scrollBarDrag
20702072
lock screen
20712073
put tVScroll into sVScroll
20722074

2073-
updateGutterRequest empty, empty, empty, empty, false, true
2075+
updateGutterRequest empty, empty, empty, empty, false, true, empty, true
20742076
unlock screen
20752077
end scrollBarDrag
20762078

0 commit comments

Comments
 (0)