-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
indent, unindent: default tab width = 4.
- Loading branch information
1 parent
151e0b0
commit 6c71b13
Showing
4 changed files
with
32 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6c71b13
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really agree with this. There is a difference between tab width, which only relates to the
'\t'
character, and indent amount, which is how much you indent code blocks. They don't have to be equal. The standard tab width is in fact 8. Changing the tab width to change indent amount is incorrect. I set my editor to tab width of 8 and indent amount of 4.6c71b13
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to revert it in that case. I'm not even sure why we have these functions in base at this point.
6c71b13
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As usual, getting rid of them would be even better.
6c71b13
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The repl code can probably get away with something much simpler than these functions for the purposes of bracketed paste.
6c71b13
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pasting code that uses standard physical tab width of 8, indent of 4 in 0.3.10:

You can see there are a few glitches (which is why I started investigating the bugs)
6c71b13
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pasting code into 0.4, with #11719, but not this commit:

Pasting code into 0.4 master, with this commit:

Since #12369 removed the global for the default value, there is no way now to get it working correctly again.
6c71b13
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having a global to configure a generic utility function seems wrong to me – that leads to the same program inexplicably working on one system and not on another, and eventually finding that they've set their default tab size (or whatever global config) to something different. Global options like that are pretty much only ok for user interface stuff, so maybe the REPL code specifically can have a global variable instead of having a global for the indentation/unindent functions.