Title: [145368] trunk/Source/WebCore
Revision
145368
Author
[email protected]
Date
2013-03-11 08:49:30 -0700 (Mon, 11 Mar 2013)

Log Message

Web Inspector: [CodeMirror] set indentation size according to devtools settings
https://bugs.webkit.org/show_bug.cgi?id=111717

Patch by Andrey Lushnikov <[email protected]> on 2013-03-11
Reviewed by Pavel Feldman.

Set up codemirror indent size according to devtools settings.

No new tests.

* inspector/front-end/CodeMirrorTextEditor.js:
(.get if):
(WebInspector.CodeMirrorTextEditor):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (145367 => 145368)


--- trunk/Source/WebCore/ChangeLog	2013-03-11 15:47:44 UTC (rev 145367)
+++ trunk/Source/WebCore/ChangeLog	2013-03-11 15:49:30 UTC (rev 145368)
@@ -1,3 +1,18 @@
+2013-03-11  Andrey Lushnikov  <[email protected]>
+
+        Web Inspector: [CodeMirror] set indentation size according to devtools settings
+        https://bugs.webkit.org/show_bug.cgi?id=111717
+
+        Reviewed by Pavel Feldman.
+
+        Set up codemirror indent size according to devtools settings.
+
+        No new tests.
+
+        * inspector/front-end/CodeMirrorTextEditor.js:
+        (.get if):
+        (WebInspector.CodeMirrorTextEditor):
+
 2013-03-11  Yury Semikhatsky  <[email protected]>
 
         Web Inspector: add per image statistics to the native memory snapshot

Modified: trunk/Source/WebCore/inspector/front-end/CodeMirrorTextEditor.js (145367 => 145368)


--- trunk/Source/WebCore/inspector/front-end/CodeMirrorTextEditor.js	2013-03-11 15:47:44 UTC (rev 145367)
+++ trunk/Source/WebCore/inspector/front-end/CodeMirrorTextEditor.js	2013-03-11 15:49:30 UTC (rev 145368)
@@ -55,6 +55,15 @@
         gutters: ["CodeMirror-linenumbers", "breakpoints"]
     });
 
+    var indent = WebInspector.settings.textEditorIndent.get();
+    if (indent === WebInspector.TextUtils.Indent.TabCharacter) {
+        this._codeMirror.setOption("indentWithTabs", true);
+        this._codeMirror.setOption("indentUnit", 4);
+    } else {
+        this._codeMirror.setOption("indentWithTabs", false);
+        this._codeMirror.setOption("indentUnit", indent.length);
+    }
+
     this._codeMirror.on("change", this._change.bind(this));
     this._codeMirror.on("gutterClick", this._gutterClick.bind(this));
     this.element.addEventListener("contextmenu", this._contextMenu.bind(this));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to