-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add atomic tabs option #107126
Add atomic tabs option #107126
Conversation
I'd recommend the name "atomic soft tabs" rather than "atomic tabs", as the latter would make some people (including me) think this changed the behavior of tab characters. "Soft tabs" is the usual name, AFAICT, for "hit the Tab key and N space characters get added to the file" feature (where N is, of course, the value of |
The Mac build failed due to a network failure. Is there any way to run it again other than pushing a dummy commit? |
Closing and reopening the PR also retriggers build steps, without needing a dummy commit. |
Amazing to see this! I was recently surprised to find that it isn't already a core feature, but now I really hope it will be. |
Ok this works perfectly as far as I can tell now. Who do I need to bribe to get it reviewed? :-D |
This treats tabs faked using spaces as if they were real tabs meaning that you can't select the middle of them.
It's very unfortunate that this isn't receiving the attention it deserves. |
@alexdima Any chance of a review? |
This looks very good! Thank you! ❤️ I just did some changes on top:
I'm sorry I didn't get to this sooner. |
Amazing, thank you so much! |
Add atomic tabs option
I've renamed the setting to |
I copied it from Atom I thought it was a decent enough name - I'm not sure I understand Anyway you guys are the bosses - not really too bothered what it is called as long as it exists! :-D By the way I made a little video to demo it, in case you want something for the release notes. |
Demo video: |
This treats tabs faked using spaces as if they were real tabs meaning that you can't select the middle of them. I have added a test, with 100% code coverage over the core logic. I've also tested this fairly extensively with hairy mixed-indentation files and with multiple cursors.
There are a few caveats that I need advice with:
I have not used
indentSize
anywhere (see this comment).I am not 100% sure I added the new
atomicTabs
setting everywhere it should be. I basically grepped forinsertSpaces
and added it in the same places (except a few bits where it didn't make sense). But that is loaaads of places so I might have missed some.3. There is one bg with the mouse handling that I need advice on (not sure I've intercepted the mouse stuff in the right place). Basically if you just click it's fine, but if you select some text and then click in the selection it won't use the atomically snapped position.This PR fixes #2798