Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1505)

Unified Diff: Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js

Issue 351213006: DevTools: [CodeMirror] indent autodetection should fallback to default indent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js
diff --git a/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js b/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js
index 35e9ed2f95c8b8ea7fcc679d07d88be4f929bf27..353315246de4ab2c4c50edcc243610ed4dab48ad 100644
--- a/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js
+++ b/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js
@@ -112,6 +112,7 @@ WebInspector.CodeMirrorTextEditor = function(url, delegate)
};
WebInspector.settings.textEditorIndent.addChangeListener(this._updateEditorIndentation, this);
+ WebInspector.settings.textEditorAutoDetectIndent.addChangeListener(this._updateEditorIndentation, this);
this._updateEditorIndentation();
WebInspector.settings.showWhitespacesInEditor.addChangeListener(this._updateCodeMirrorMode, this);
WebInspector.settings.textEditorBracketMatching.addChangeListener(this._enableBracketMatchingIfNeeded, this);
@@ -275,6 +276,7 @@ WebInspector.CodeMirrorTextEditor.prototype = {
dispose: function()
{
WebInspector.settings.textEditorIndent.removeChangeListener(this._updateEditorIndentation, this);
+ WebInspector.settings.textEditorAutoDetectIndent.removeChangeListener(this._updateEditorIndentation, this);
WebInspector.settings.showWhitespacesInEditor.removeChangeListener(this._updateCodeMirrorMode, this);
WebInspector.settings.textEditorBracketMatching.removeChangeListener(this._enableBracketMatchingIfNeeded, this);
},
@@ -327,7 +329,7 @@ WebInspector.CodeMirrorTextEditor.prototype = {
minimumIndent = indent;
}
if (minimumIndent === Infinity)
- return WebInspector.TextUtils.Indent.FourSpaces;
+ return WebInspector.settings.textEditorIndent.get();
return new Array(minimumIndent + 1).join(" ");
},
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698