Changeset 246419 in webkit
- Timestamp:
- Jun 13, 2019 7:11:17 PM (5 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r246410 r246419 1 2019-06-13 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Settings: indent type and size settings aren't respected everywhere 4 https://bugs.webkit.org/show_bug.cgi?id=198804 5 6 Reviewed by Timothy Hatcher. 7 8 * UserInterface/Views/CodeMirrorEditor.js: 9 (WI.CodeMirrorEditor.create): 10 When creating a `CodeMirror` instance, default to using the global `Setting`s as the options. 11 If an override is specified in `options`, it will take precedence and the `CodeMirror` will 12 ignore any changes to the `Setting` as well. 13 14 * UserInterface/Views/TextEditor.js: 15 (WI.TextEditor): 16 (WI.TextEditor.prototype.close): Deleted. 17 18 * UserInterface/Views/AuditTestCaseContentView.js: 19 (WI.AuditTestCaseContentView.prototype.layout): 20 * UserInterface/Views/BreakpointActionView.js: 21 (WI.BreakpointActionView.prototype._updateBody): 22 * UserInterface/Views/ConsolePrompt.js: 23 (WI.ConsolePrompt): 24 * UserInterface/Views/ScopeChainDetailsSidebarPanel.js: 25 (WI.ScopeChainDetailsSidebarPanel.prototype._addWatchExpressionButtonClicked): 26 Remove overrides that aren't necessary for `CodeMirror` to fit in the container element: 27 - `showWhitespaceCharacters` 28 - `indentWithTabs` 29 - `indentUnit` 30 31 * UserInterface/Views/SourceCodeTextEditor.js: 32 (WI.SourceCodeTextEditor.prototype.close): 33 * UserInterface/Views/ShaderProgramContentView.js: 34 (WI.ShaderProgramContentView.prototype.closed): Deleted. 35 * UserInterface/Views/TextContentView.js: 36 (WI.TextContentView.prototype.closed): Deleted. 37 * UserInterface/Views/TextResourceContentView.js: 38 (WI.TextResourceContentView.prototype.closed): 39 Delete the logic for removing event listeners from global `Setting`, as it didn't work 40 anyways, since none of the event listeners were added using a `thisObject`. 41 1 42 2019-06-13 Devin Rousso <drousso@apple.com> 2 43 -
trunk/Source/WebInspectorUI/UserInterface/Views/AuditTestCaseContentView.js
r246025 r246419 218 218 readOnly: true, 219 219 lineWrapping: true, 220 showWhitespaceCharacters: WI.settings.showWhitespaceCharacters.value,221 220 styleSelectedText: true, 222 221 }); -
trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointActionView.js
r238048 r246419 159 159 lineWrapping: true, 160 160 mode: "text/javascript", 161 indentWithTabs: true,162 indentUnit: 4,163 161 matchBrackets: true, 164 162 value: this._action.data || "", -
trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorEditor.js
r243826 r246419 34 34 element.classList.toggle("read-only", options.readOnly); 35 35 36 let codeMirror = new CodeMirror(element, options); 36 let codeMirror = new CodeMirror(element, { 37 // These values will be overridden by any value with the same key in `options`. 38 indentWithTabs: WI.settings.indentWithTabs.value, 39 indentUnit: WI.settings.indentUnit.value, 40 tabSize: WI.settings.tabSize.value, 41 lineWrapping: WI.settings.enableLineWrapping.value, 42 showWhitespaceCharacters: WI.settings.showWhitespaceCharacters.value, 43 ...options, 44 }); 45 46 function listenForChange(setting, codeMirrorOption) { 47 if (options[codeMirrorOption] !== undefined) 48 return; 49 50 setting.addEventListener(WI.Setting.Event.Changed, (event) => { 51 codeMirror.setOption(codeMirrorOption, setting.value); 52 }); 53 } 54 listenForChange(WI.settings.indentWithTabs, "indentWithTabs"); 55 listenForChange(WI.settings.indentUnit, "indentUnit"); 56 listenForChange(WI.settings.tabSize, "tabSize"); 57 listenForChange(WI.settings.enableLineWrapping, "lineWrapping"); 58 listenForChange(WI.settings.showWhitespaceCharacters, "showWhitespaceCharacters"); 37 59 38 60 // Override some Mac specific keybindings. -
trunk/Source/WebInspectorUI/UserInterface/Views/ConsolePrompt.js
r244264 r246419 41 41 lineWrapping: true, 42 42 mode: {name: mimeType, globalVars: true}, 43 indentWithTabs: true,44 indentUnit: 4,45 43 matchBrackets: true 46 44 }); -
trunk/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js
r243242 r246419 365 365 lineWrapping: true, 366 366 mode: "text/javascript", 367 indentWithTabs: true,368 indentUnit: 4,369 367 matchBrackets: true, 370 368 value: "", -
trunk/Source/WebInspectorUI/UserInterface/Views/ShaderProgramContentView.js
r243355 r246419 100 100 } 101 101 102 closed()103 {104 this._vertexEditor.close();105 this._fragmentEditor.close();106 107 super.closed();108 }109 110 102 get supportsSave() 111 103 { -
trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js
r243727 r246419 166 166 close() 167 167 { 168 super.close();169 170 168 if (this._supportsDebugging) { 171 169 WI.Breakpoint.removeEventListener(null, null, this); -
trunk/Source/WebInspectorUI/UserInterface/Views/TextContentView.js
r243355 r246419 93 93 } 94 94 95 closed()96 {97 super.closed();98 99 this._textEditor.close();100 }101 102 95 get supportsSave() 103 96 { -
trunk/Source/WebInspectorUI/UserInterface/Views/TextEditor.js
r246178 r246419 34 34 this._codeMirror = WI.CodeMirrorEditor.create(this.element, { 35 35 readOnly: true, 36 indentWithTabs: WI.settings.indentWithTabs.value,37 indentUnit: WI.settings.indentUnit.value,38 tabSize: WI.settings.tabSize.value,39 36 lineNumbers: true, 40 lineWrapping: WI.settings.enableLineWrapping.value,41 37 matchBrackets: true, 42 38 autoCloseBrackets: true, 43 showWhitespaceCharacters: WI.settings.showWhitespaceCharacters.value,44 39 styleSelectedText: true, 45 });46 47 WI.settings.indentWithTabs.addEventListener(WI.Setting.Event.Changed, (event) => {48 this._codeMirror.setOption("indentWithTabs", WI.settings.indentWithTabs.value);49 });50 51 WI.settings.indentUnit.addEventListener(WI.Setting.Event.Changed, (event) => {52 this._codeMirror.setOption("indentUnit", WI.settings.indentUnit.value);53 });54 55 WI.settings.tabSize.addEventListener(WI.Setting.Event.Changed, (event) => {56 this._codeMirror.setOption("tabSize", WI.settings.tabSize.value);57 });58 59 WI.settings.enableLineWrapping.addEventListener(WI.Setting.Event.Changed, (event) => {60 this._codeMirror.setOption("lineWrapping", WI.settings.enableLineWrapping.value);61 });62 63 WI.settings.showWhitespaceCharacters.addEventListener(WI.Setting.Event.Changed, (event) => {64 this._codeMirror.setOption("showWhitespaceCharacters", WI.settings.showWhitespaceCharacters.value);65 40 }); 66 41 … … 586 561 { 587 562 this._visible = false; 588 }589 590 close()591 {592 WI.settings.indentWithTabs.removeEventListener(null, null, this);593 WI.settings.indentUnit.removeEventListener(null, null, this);594 WI.settings.tabSize.removeEventListener(null, null, this);595 WI.settings.enableLineWrapping.removeEventListener(null, null, this);596 WI.settings.showWhitespaceCharacters.removeEventListener(null, null, this);597 563 } 598 564 -
trunk/Source/WebInspectorUI/UserInterface/Views/TextResourceContentView.js
r243355 r246419 128 128 WI.settings.showJavaScriptTypeInformation.removeEventListener(null, null, this); 129 129 WI.settings.enableControlFlowProfiler.removeEventListener(null, null, this); 130 131 this._textEditor.close();132 130 } 133 131
Note: See TracChangeset
for help on using the changeset viewer.