Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.

Using hard tabs #126

Open
thecaralice opened this issue Nov 8, 2023 · 3 comments · May be fixed by #127
Open

Using hard tabs #126

thecaralice opened this issue Nov 8, 2023 · 3 comments · May be fixed by #127

Comments

@thecaralice
Copy link

I suggest adding a configuration option for enforcing hard tab usage instead of 1d4 spaces. Maybe also respect .editorconfig for that?

@astrale-sharp
Copy link
Owner

Hey there :)
thanks for your suggestion,

This would be somewhat hard to implement right, should we check all spaces and replace consecutive 2 spaces (or 4?) by tabs and remove the rest of the spaces? but only do that at the start of lines.

It's not impossible and I wouldn't reject a PR implementing it.

To anyone interested, I would suggest handling this with regex after the formatting is done.

Also, this is only run in an editor with nvarner/typst-lsp, that's the software that has access to .editorconfig so this would need to be implemented here once we have that feature you requested.

@thecaralice
Copy link
Author

This would be somewhat hard to implement right, should we check all spaces and replace consecutive 2 spaces (or 4?) by tabs and remove the rest of the spaces? but only do that at the start of lines.

Well, what I have in mind is simply reindenting everything; kinda indent_space=1 but with tabs

@astrale-sharp
Copy link
Owner

Well I think this could also work!

@thecaralice thecaralice linked a pull request Nov 8, 2023 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants