Created attachment 149939 [details] Tab character width setting In source editor, tab character width is 8 characters long. Since WebKit supports tab-size CSS property (https://bugs.webkit.org/show_bug.cgi?id=52994), it would be nice to make tab character width configurable.
@Nikita, do you have a patch for this?
(In reply to comment #1) > @Nikita, do you have a patch for this? No, but I can make one if think it’s a valuable feature.
> No, but I can make one if think it’s a valuable feature. I think it would be useful.
Created attachment 150494 [details] WIP I’m not sure about TextIndent class I introduced.
Comment on attachment 150494 [details] WIP View in context: https://bugs.webkit.org/attachment.cgi?id=150494&action=review > Source/WebCore/inspector/front-end/SettingsScreen.js:282 > + p.appendChild(this._createSelectSetting(WebInspector.UIString("Indent size"), [ Indentation size and tab size can have different values. Indentation size is a "model" property, it affects the file being saved on disk. Tab size is "view" property, it only affects visual representation. I'd suggest that you add a selector for the tab size and use it in the TextEditor.js only. The model part of the code should stay the same. > Source/WebCore/inspector/front-end/TextEditorModel.js:493 > +function TextIndent() I don't think you need this, but if you did, you would need to format it as: /** * @constructor */ WebInspector.TextEditorModel.Indent = function() { } ...
Created attachment 150790 [details] Sublime Text 2 indent settings (In reply to comment #5) > (From update of attachment 150494 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=150494&action=review > > > Source/WebCore/inspector/front-end/SettingsScreen.js:282 > > + p.appendChild(this._createSelectSetting(WebInspector.UIString("Indent size"), [ > > Indentation size and tab size can have different values. Indentation size is a "model" property, it affects the file being saved on disk. Tab size is "view" property, it only affects visual representation. I'd suggest that you add a selector for the tab size and use it in the TextEditor.js only. The model part of the code should stay the same. Why would someone want a tab size different from an indentation size? I’ve attached a screenshot of indentation settings in Sublime Text 2; it doesn’t distinguish indentation size and tab size.
> Why would someone want a tab size different from an indentation size? I’ve attached a screenshot of indentation settings in Sublime Text 2; it doesn’t distinguish indentation size and tab size. Well, all the other editors I know distinguish between the two and it makes sense to me. As I explained above, one is about model and another is about view. Imagine the code guidelines where indentation is done using 4 spaces, while tab character is still allowed and should be 8 characters long. Or indentation is two tabs.
(In reply to comment #7) > > Why would someone want a tab size different from an indentation size? I’ve attached a screenshot of indentation settings in Sublime Text 2; it doesn’t distinguish indentation size and tab size. > > Well, all the other editors I know distinguish between the two and it makes sense to me. As I explained above, one is about model and another is about view. Imagine the code guidelines where indentation is done using 4 spaces, while tab character is still allowed and should be 8 characters long. Or indentation is two tabs. I see IDEs such as Xcode and IntelliJ IDEA do distinguish the two. Many lightweight code editors such as Chocolat.app and Textmate don’t. Personally, I just want to make a tab character 4 spaces width. It’s a default tab width in all the editors I’ve mentioned above.
Created attachment 151459 [details] Make the Tab character 4 spaces width I suggest to make this small change for now. If someone actually want to configure the Tab size, we’ll see the bug filled.
Comment on attachment 151459 [details] Make the Tab character 4 spaces width Clearing flags on attachment: 151459 Committed r122227: <http://trac.webkit.org/changeset/122227>
All reviewed patches have been landed. Closing bug.