Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Fix codefolding
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonLaster committed Jan 12, 2018
1 parent d805414 commit 243f91e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/utils/editor/create-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
// @flow

import SourceEditor from "./source-editor";
import { isEnabled } from "devtools-config";
import { features } from "../prefs";

export function createEditor() {
const gutters = ["breakpoints", "hit-markers", "CodeMirror-linenumbers"];

if (isEnabled("codeFolding")) {
if (features.codeFolding) {
gutters.push("CodeMirror-foldgutter");
}

return new SourceEditor({
mode: "javascript",
foldGutter: isEnabled("codeFolding"),
enableCodeFolding: isEnabled("codeFolding"),
foldGutter: features.codeFolding,
enableCodeFolding: features.codeFolding,
readOnly: true,
lineNumbers: true,
theme: "mozilla",
Expand Down
5 changes: 3 additions & 2 deletions src/utils/prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ if (isDevelopment()) {
pref("devtools.debugger.features.remove-command-bar-options", true);
pref("devtools.debugger.features.code-coverage", false);
pref("devtools.debugger.features.event-listeners", false);
pref("devtools.debugger.features.code-folding", true);
pref("devtools.debugger.features.code-folding", false);
pref("devtools.debugger.features.outline", true);
pref("devtools.debugger.features.column-breakpoints", true);
}
Expand Down Expand Up @@ -87,7 +87,8 @@ export const features = new PrefsHelper("devtools.debugger.features", {
workers: ["Bool", "workers"],
codeCoverage: ["Bool", "code-coverage"],
eventListeners: ["Bool", "event-listeners"],
outline: ["Bool", "outline"]
outline: ["Bool", "outline"],
codeFolding: ["Bool", "code-folding"]
});

if (prefs.debuggerPrefsSchemaVersion !== prefsSchemaVersion) {
Expand Down

0 comments on commit 243f91e

Please sign in to comment.