Skip to content

Commit 55e9c57

Browse files
committed
fix: choppy cursor selection performance issue
1 parent c737b16 commit 55e9c57

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

src/editor/EditorManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ define(function (require, exports, module) {
775775

776776
// Set up event dispatching
777777
EventDispatcher.makeEventDispatcher(exports);
778-
EventDispatcher.setLeakThresholdForEvent(EVENT_ACTIVE_EDITOR_CHANGED, 25);
778+
EventDispatcher.setLeakThresholdForEvent(EVENT_ACTIVE_EDITOR_CHANGED, 30);
779779

780780
// File-based preferences handling
781781
exports.on(EVENT_ACTIVE_EDITOR_CHANGED, function (e, current) {

src/extensions/default/Git/src/GutterManager.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ define(function (require, exports) {
4949

5050
function _cursorActivity(_evt, editor){
5151
// this is to prevent a gutter gap in the active line if there is no color on this line.
52+
if (editor.hasSelection()){
53+
// we dont show the gutter gap color when there is a selection. also adding dummy gutter is expensive
54+
// and make test selection with cursor choppy
55+
return;
56+
}
5257
_addDummyGutterMarkerIfNotExist(editor._codeMirror, editor.getCursorPos().line);
5358
}
5459

src/extensionsIntegrated/CSSColorPreview/main.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,11 @@ define(function (require, exports, module) {
213213

214214
function _cursorActivity(_evt, editor){
215215
// this is to prevent a gutter gap in the active line if there is no color on this line.
216+
if(editor.hasSelection()){
217+
// we dont show the gutter gap color when there is a selection. also adding dummy gutter is expensive
218+
// and make test selection with cursor choppy
219+
return;
220+
}
216221
_addDummyGutterMarkerIfNotExist(editor, editor.getCursorPos().line);
217222
if(editor._currentlyColorMarkedLine){
218223
editor.clearAllMarks(COLOR_MARK_NAME);

src/extensionsIntegrated/HtmlTagSyncEdit/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ define(function (require, exports, module) {
237237

238238
function cursorActivity() {
239239
const cursor = activeEditor.getCursorPos();
240-
if(activeEditor.hasMultipleCursors()){
240+
if(activeEditor.hasMultipleCursors() || activeEditor.hasSelection()){
241241
clearRenameMarkers();
242242
return;
243243
}

0 commit comments

Comments
 (0)