thehogfather / brackets-code-folding

Code folding extension for brackets IDE
134 stars 42 forks source link

Problem if no open file #13

Closed mmontagnana closed 11 years ago

mmontagnana commented 11 years ago

Hi.

I upgraded the code-folding extension to the latest version (0.0.5).

I noticed that if thers isn't any open file in Brackets I can't switch neither switch project nor open a new folder: nothing happens when I try to perform one of such actions. If I open a Console in the Developer Tools I see that I get an "Uncaught TypeError: Cannot call method 'lineCount' of null" in line 293 of main.js. If a file is open everything is ok.

I solved this problem modifying the _doSave function like this:

        function _doSave() {
            var editor = EditorManager.getCurrentFullEditor();
            if (editor) {
                saveLineFolds(editor);
            }
        }

Now everything's fine and I don't get errors.

Thank you for the attention.

thehogfather commented 11 years ago

Cheers! :+1: