RESOLVED FIXED Bug 90172
Web Inspector: Make the Tab character 4 spaces width
https://bugs.webkit.org/show_bug.cgi?id=90172
Summary Web Inspector: Make the Tab character 4 spaces width
Nikita Vasilyev
Reported 2012-06-28 06:41:45 PDT
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.
Attachments
Tab character width setting (4.54 KB, image/png)
2012-06-28 06:41 PDT, Nikita Vasilyev
no flags
WIP (4.80 KB, patch)
2012-07-02 16:07 PDT, Nikita Vasilyev
no flags
Sublime Text 2 indent settings (23.50 KB, image/png)
2012-07-04 07:13 PDT, Nikita Vasilyev
no flags
Make the Tab character 4 spaces width (1.07 KB, patch)
2012-07-10 07:31 PDT, Nikita Vasilyev
no flags
Pavel Feldman
Comment 1 2012-06-29 21:59:34 PDT
@Nikita, do you have a patch for this?
Nikita Vasilyev
Comment 2 2012-06-30 00:34:51 PDT
(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.
Pavel Feldman
Comment 3 2012-07-02 06:22:27 PDT
> No, but I can make one if think it’s a valuable feature. I think it would be useful.
Nikita Vasilyev
Comment 4 2012-07-02 16:07:21 PDT
Created attachment 150494 [details] WIP I’m not sure about TextIndent class I introduced.
Pavel Feldman
Comment 5 2012-07-04 06:26:09 PDT
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() { } ...
Nikita Vasilyev
Comment 6 2012-07-04 07:13:27 PDT
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.
Pavel Feldman
Comment 7 2012-07-04 07:54:56 PDT
> 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.
Nikita Vasilyev
Comment 8 2012-07-05 07:57:34 PDT
(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.
Nikita Vasilyev
Comment 9 2012-07-10 07:31:33 PDT
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.
WebKit Review Bot
Comment 10 2012-07-10 09:11:25 PDT
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>
WebKit Review Bot
Comment 11 2012-07-10 09:11:30 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.