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

Per-document indentation style, and indent-style auto-detection. #245

Merged
merged 8 commits into from
Jun 15, 2021

Conversation

cessen
Copy link
Contributor

@cessen cessen commented Jun 13, 2021

  • Move the primary indentation-style setting into Document.
  • Attempt to auto-detect the indentation style of a document when first loading it, but fall back to a language-based default when confidence is too low.
  • Add a command to manually set a document's indentation style.

@cessen cessen requested a review from archseer June 13, 2021 18:32
helix-term/src/ui/editor.rs Outdated Show resolved Hide resolved
helix-view/src/document.rs Outdated Show resolved Hide resolved
helix-view/src/document.rs Outdated Show resolved Hide resolved
helix-view/src/document.rs Show resolved Hide resolved
helix-view/src/document.rs Outdated Show resolved Hide resolved
@cessen cessen marked this pull request as ready for review June 14, 2021 02:47
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.

Just some minor nits

helix-term/src/commands.rs Outdated Show resolved Hide resolved
helix-term/src/commands.rs Outdated Show resolved Hide resolved
This also moves the primary indentation-style setting into Document.
Also cleaned up the status line code a little.
- Move char functions into their own module under helix_core.
- Use matches!() macro where appropriate.
- Use a static lifetime on indent_unit() now that we can.
* Clean up "indent-style" command argument parsing.
* Adjust command's name to match the style of other commands.
* Add a "0" alias to the command, for tabs indent style.
@cessen cessen merged commit d415a66 into helix-editor:master Jun 15, 2021
@cessen cessen deleted the indent_detect branch June 15, 2021 01:51
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.

3 participants