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

Auto-indent #294

Open
Curculigo opened this issue Jul 25, 2024 · 4 comments
Open

Auto-indent #294

Curculigo opened this issue Jul 25, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@Curculigo
Copy link

For example, you typed { and press enter, you will not want to have to type TAB manually. This is the most basic case, though. Please see how other editors are doing and copy. Thank you.

@SpartanJ SpartanJ self-assigned this Jul 25, 2024
@SpartanJ SpartanJ added the enhancement New feature or request label Jul 25, 2024
@SpartanJ
Copy link
Owner

Related to #67.

@Curculigo
Copy link
Author

Curculigo commented Aug 25, 2024

Could you learn something from the implementations of other text editors?

https://github.com/tsujan/FeatherPad/tree/master/featherpad/highlighter

https://github.com/ScintillaOrg/lexilla/tree/master/lexers

@Curculigo
Copy link
Author

You have added support for code folding in SpartanJ/eepp@851dfc3. I think it will not be hard for you to add support for basic auto-indent.

@SpartanJ
Copy link
Owner

Could you learn something from the implementations of other text editors?

Not from Scintilla/lexilla since it doesn't support auto-indentation.
And from Featherpad... IDK what you mean, auto-indentation on Featherpad works the same as ecode right now, it will keep the indentation from the previous line when you insert a new line, but that's it (I don't consider that true auto-indentation but it has always been more than enough for me). The only difference is that ecode does not allow to disable the auto-indentation since it's enabled by default and there's no option to disable it (i might have to add it but who doesn't want that).

You have added support for code folding in SpartanJ/eepp@851dfc3. I think it will not be hard for you to add support for basic auto-indent.

Auto-indentation does not depend on folding ranges, folding range won't exist while you write any new block of code, you cannot base the auto-indentation from that. True auto-indentation requires language specific code and usually some knowledge of the AST if possible. Also auto-indentation is very user-specific, best solution is supporting tree-sitter, but that won't come soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants