-
Notifications
You must be signed in to change notification settings - Fork 56
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
Conversation
settings are changed Fixes eclipse-tm4e#460 Signed-off-by: azerr <azerr@redhat.com>
This PR requires eclipse-platform/eclipse.platform.text#108 |
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. |
The main problem with this strategy is when you have no spaces. Ex:
When you type enter inside |
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 why you have closed this PR? |
The master branch have been deleted, it's now |
I've restored master, can you please try retargetting the PR? IIRC it is doable from the GitHub UI. |
@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. |
@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. |
@angelozerr do you think this PR will ever happen? The required PR eclipse-platform/eclipse.platform.text#108 got closed without being merged. |
Closing this PR for now as The functional issue has already been solved by #517. Feel free to reopen. |
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