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

fix: On enter rule don't use the proper insert spaces / tab width when those settings are changed #461

Closed

Conversation

angelozerr
Copy link
Contributor

On enter rule don't use the proper insert spaces / tab width when those settings are changed

Fixes #460

Signed-off-by: azerr azerr@redhat.com

settings are changed

Fixes eclipse-tm4e#460

Signed-off-by: azerr <azerr@redhat.com>
@angelozerr
Copy link
Contributor Author

This PR requires eclipse-platform/eclipse.platform.text#108

@mickaelistria
Copy link
Contributor

Instead of looking at properties, can't we try to first deduce the insert spaces/tabs from previous lines in the file? Usually this leads to good results.

@angelozerr
Copy link
Contributor Author

The main problem with this strategy is when you have no spaces. Ex:

{}

When you type enter inside {|} you don't know the spaces / tabs to use.

@angelozerr
Copy link
Contributor Author

Another problem is if you have this usecase comments with tabs and editor is configured with spaces:

/*
\t\t */
{|}

when you press on Enter, it will indent with tabs instead of spaces.

IMHO, the on enter rules should follow the editor configuration and not the previous line of document. The on enter rule is a magic indentation, it is a kind of formatting.

vsocde uses the editor settings too for this on enter rules and not the previous line text.

@mickaelistria mickaelistria deleted the branch eclipse-tm4e:main March 13, 2023 08:29
@angelozerr
Copy link
Contributor Author

@mickaelistria why you have closed this PR?

@mickaelistria
Copy link
Contributor

The master branch have been deleted, it's now main. I'll see whether it's possible to retarget this PR.

@mickaelistria mickaelistria reopened this Mar 13, 2023
@mickaelistria
Copy link
Contributor

I've restored master, can you please try retargetting the PR? IIRC it is doable from the GitHub UI.

@mickaelistria mickaelistria changed the base branch from master to main March 13, 2023 09:51
@sebthom sebthom changed the title On enter rule don't use the proper insert spaces / tab width when those settings are changed fix: On enter rule don't use the proper insert spaces / tab width when those settings are changed Mar 13, 2023
@github-actions github-actions bot added the bug label Mar 13, 2023
@angelozerr
Copy link
Contributor Author

@mickaelistria I created a new PR at #517 which use activate text editor and not the ITextEditorAware which doesn't exists for the moment in platform text. I think using activate text editor for strategy is correct.

@sebthom
Copy link
Member

sebthom commented Aug 14, 2023

@angelozerr is this PR still relevant or can we close it?

@angelozerr
Copy link
Contributor Author

@angelozerr is this PR still relevant or can we close it?

Yes it is relevant again, but I have not find time to rebase it from master.

@sebthom
Copy link
Member

sebthom commented Nov 6, 2023

@angelozerr do you think this PR will ever happen? The required PR eclipse-platform/eclipse.platform.text#108 got closed without being merged.

@sebthom
Copy link
Member

sebthom commented Jan 9, 2024

Closing this PR for now as ITextEditorAware doesn't seem to be coming. eclipse-platform/eclipse.platform.text#108 was been closed and there is no follow-up attempt in https://github.com/eclipse-platform/eclipse.platform.ui

The functional issue has already been solved by #517.

Feel free to reopen.

@sebthom sebthom closed this Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

On enter rule don't use the proper insert spaces / tab width when those settings are changed
3 participants