-
Notifications
You must be signed in to change notification settings - Fork 16
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
Match Mixed Indent of Previous Line #606
Comments
I still see this problem on v2.5.1, and it continues to be a problem when I load Java projects from other IDEs. For now, I am mostly interested in matching the whitespace of the previous line - the tab/whitespace configuration will probably need to be a separate issue. |
You can test the behavior now, @JoelProminic . You can test this with OSX branch build. |
This mostly worked, but I see an extra space in the new line after the tab only line. Here is my test file: |
I noticed that the default Java file for a new Java Gradle project has mixed spaces and tabs. We should check the templates to make sure that we are using the same indent consistently (tabs for now, until we have more Moonshine support for switching between tabs and spaces). |
I noticed a bug during my tests where the line with no indent duplicates when pressed Enter against. This issue is now fixed. The tiny tab problem, it seems an old editor issue. To test, I downloaded last stable build, where I able to reproduce the problem as well:
We probably need to go into more deeper in editor source. |
This issue now merged into master. |
I tested this again in a Java class, and the indentation is duplicated like I expect. I still see the "tiny tab" issue, though. In my case, I can trigger this by pressing Tab, four spaces, and then Tab again on the first (or last) line of the file. |
Some more investigation into tiny tab issue taken me to this portion of the codes - https://github.com/prominic/Moonshine-IDE/blob/master/ide/MoonshineSharedCore/src/actionScripts/ui/editor/text/TextLineRenderer.as#L49. It seems we have a static char-width which possibly creates different behaviour between scenarios. This possibly makes sense since a tab can consists of multiply of char-widths. I confirm if I manually modify the value I can get mixed Tab+Space results where mostly breaks after a certain time. This value generation maybe never worked-on by the author which was initially planned to. I do not have any immediate fix on this regard, yet. |
@rat-moonshine Expose this as separate issue. I'm closing this cause according to your message it's merged. |
I did some quick tests with the merged code in master, and created a separate issue for the "tiny tab" bug. |
I was working with a Java Maven project and the latest Bamboo build of Monshine today, and I noticed that Moonshine did not always automatically match the indent of the previous line when adding a new line. After some investigation I found that when the previous line was indented with tabs, it worked, but when indented with spaces, it didn't work.
I would like to see the auto-indent reproduce both tabs and spaces.
Note that we will eventually need some tools to let the user choose to work with either tabs or spaces for the indent - this is a common problem when working with other developers with different editors.
The text was updated successfully, but these errors were encountered: