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

Setting saveFoldStates preference to false breaks code folding #13264

@lkcampbell

Description

@lkcampbell

OS: MacS 10.12.3 Sierra

Brackets Version: Release 1.9 build 1.9.0-17312 (release 189f6d3)

Repro Steps:

  1. Add the line "code-folding.saveFoldStates": false to the brackets.json preference file.
  2. Reload Brackets

Observed Results:
Code folding stops working. Error messages in the Dev Console:

/utils/EventDispatcher.js:231 Exception in 'activeEditorChange' listener on Object {_eventHandlers: Object, _EventDispatcher: true} TypeError: Cannot convert undefined or null to object TypeError: Cannot convert undefined or null to object
    at _isCurrentlyFolded (file:///Applications/Brackets.app/Contents/www/extensions/default/CodeFolding/foldhelpers/foldgutter.js:68:31)
    at updateFoldInfo (file:///Applications/Brackets.app/Contents/www/extensions/default/CodeFolding/foldhelpers/foldgutter.js:92:22)
    at file:///Applications/Brackets.app/Contents/www/extensions/default/CodeFolding/foldhelpers/foldgutter.js:137:13
    at runInOp (/thirdparty/CodeMirror/lib/codemirror.js:3837:26)
    at CodeMirror.operation (/thirdparty/CodeMirror/lib/codemirror.js:8131:35)
    at updateInViewport (file:///Applications/Brackets.app/Contents/www/extensions/default/CodeFolding/foldhelpers/foldgutter.js:136:12)
    at CodeMirror.<anonymous> (file:///Applications/Brackets.app/Contents/www/extensions/default/CodeFolding/foldhelpers/foldgutter.js:381:17)
    at eval (/thirdparty/CodeMirror/lib/codemirror.js:3847:20)
    at CodeMirror.setOption (/thirdparty/CodeMirror/lib/codemirror.js:7748:50)
    at setupGutterEventListeners (file:///Applications/Brackets.app/Contents/www/extensions/default/CodeFolding/main.js:285:12)trigger @ /utils/EventDispatcher.js:231_notifyActiveEditorChanged @ /editor/EditorManager.js:161_handleCurrentFileChange @ /editor/EditorManager.js:178trigger @ /utils/EventDispatcher.js:229(anonymous function) @ /view/MainViewManager.js:1120trigger @ /utils/EventDispatcher.js:229Pane._notifyCurrentViewChange @ /view/Pane.js:896Pane.showView @ /view/Pane.js:1208_showEditor @ /editor/EditorManager.js:567openDocument @ /editor/EditorManager.js:639_edit @ /view/MainViewManager.js:1212(anonymous function) @ /view/MainViewManager.js:1277j @ thirdparty.min.js:19k.fireWith @ thirdparty.min.js:19e.(anonymous function) @ thirdparty.min.js:19(anonymous function) @ /document/DocumentManager.js:374j @ thirdparty.min.js:19k.fireWith @ thirdparty.min.js:19e.(anonymous function) @ thirdparty.min.js:19(anonymous function) @ /file/FileUtils.js:82(anonymous function) @ /filesystem/File.js:121(anonymous function) @ /filesystem/impls/appshell/AppshellFileSystem.js:370
/utils/EventDispatcher.js:232 Assertion failed:

Expected Results:
Code folding should continue to work normally. No error messages in the Dev Tools console.

Other Notes:
The problem occurs with all extensions disabled.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions