Skip to content

Commit

Permalink
Addresses adobe#13282 which caused performance issues when navigating…
Browse files Browse the repository at this point in the history
… between large folded files.

A check is now performed to ensure we do not attempt to restore line folds for editors whose folds have already been initialised.
  • Loading branch information
thehogfather committed Apr 16, 2017
1 parent 7adf634 commit 5ae77a4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/extensions/default/CodeFolding/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ define(function (require, exports, module) {
EditorManager = brackets.getModule("editor/EditorManager"),
ProjectManager = brackets.getModule("project/ProjectManager"),
ViewStateManager = brackets.getModule("view/ViewStateManager"),
MainViewManager = brackets.getModule("view/MainViewManager"),
KeyBindingManager = brackets.getModule("command/KeyBindingManager"),
ExtensionUtils = brackets.getModule("utils/ExtensionUtils"),
Menus = brackets.getModule("command/Menus"),
Expand Down Expand Up @@ -329,14 +330,14 @@ define(function (require, exports, module) {
}

/**
* When a brand new editor is seen, initialise fold-gutter and restore line folds in it. Save line folds in
* departing editor in case it's getting closed.
* When a brand new editor is seen, initialise fold-gutter and restore line folds in it.
* Save line folds in departing editor in case it's getting closed.
* @param {object} event the event object
* @param {Editor} current the current editor
* @param {Editor} previous the previous editor
*/
function onActiveEditorChanged(event, current, previous) {
if (current) {
if (current && !current._codeMirror._lineFolds) {
enableFoldingInEditor(current);
}
if (previous) {
Expand Down

0 comments on commit 5ae77a4

Please sign in to comment.