Skip to content
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

Indent with tabs by default (when no specific indentation settings apply) #3095

Merged
merged 1 commit into from
Jul 22, 2022

Conversation

usagi-flow
Copy link
Contributor

This tiny code change adjusts the default indentation behavior when no language-specific or user-defined setting applies.

Wait, don't run away... We're not having the tabs vs. spaces discussion!

Keep in mind we're talking about the behavior when Helix is opened for regular text files or with an empty scratch buffer:
At that moment, as a user, I expect the editor to act like a simple, "dumb editor".
At that moment I don't expect Helix to replace tabs with spaces because Helix thinks I could be programming in a language where spaces could be more important.

A simple, dumb editor, inserts a tab when I press [Tab], and a space when I press [Space].

There's many examples of default behavior in simple editors; KWrite, Notepad, Writer on Mac, ... but also Vim and Emacs (when they're not applying language-specific settings). They all insert a tab by default.

Therefore, for the sake of consistency with existing "expected" behavior, and because Helix is not an IDE at that moment, I suggest to change its default behavior.

@p-e-w
Copy link

p-e-w commented Jul 19, 2022

I was going to "run away" like you said, but the argument

A simple, dumb editor, inserts a tab when I press [Tab], and a space when I press [Space].

completely convinced me. This is the correct approach! 👍

@sbromberger
Copy link
Contributor

I was also ready to jump in and start protesting but this is a sound argument. My mind has been changed!

Copy link
Member

@archseer archseer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm convinced too!

@archseer archseer merged commit b05fcaa into helix-editor:master Jul 22, 2022
@usagi-flow usagi-flow deleted the feat-default-indent branch July 22, 2022 16:35
@AceofSpades5757 AceofSpades5757 mentioned this pull request Aug 4, 2022
thomasskk pushed a commit to thomasskk/helix that referenced this pull request Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants