-
Notifications
You must be signed in to change notification settings - Fork 22
paste - undo - redo combination causes a weirdly formatted file #87
Comments
Hey, thx for reporting! Can you post a picture of that bug? |
Below is what happens: File used for demoing the issue is an layout configuration xml file from Magento. But this behavior will happen on php files also. After the file gets mall formatted you can't undo it back to a working state. Frankly I had problems on getting the issue to fire but saving with redoing / undoing changes and saving will cause a file to break. |
Hey, I couldn't reproduce this issue but I committed some code which fixes a possible cause for this. Would you mind to try out the fix from the sources? |
Tried to open the project form the sources but probably missing some necessary bits on my netbeans
Any tips as I'll probably try again in the next 24 hours. |
I guess you had no internet :P That's mandatory for maven to get the related dependencies. Another option is that the repository for plexus-utils 1.1 was down for a while. This version number actually reminds me that we could update some dependencies but that's another story :) |
@Yserz I just neglegted to press the "resolve" button on the "Resolve Project problems" :) Im presuming that I got the build to install the updated version and I get the issue much easier now. Presumably this error relates to the issue: java.lang.NullPointerException |
Hopefully with this you can repro the issue if you use this file: https://gist.github.com/FinBoWa/dd0034fbd516977e527d Open that file in a php project.
It will break the presentation of the document. If it doesn't happen on the first undo try, just paste the same block again. Also closing and reopening and then doing undo save should start causing issues. I actually got it to eat ALL the contents of the xml file now. Not sure does this happen with a project that contains only few files. |
Sounds like I made it even worse :o The main issue is with the ´StyledDocumentWriter´ right here |
I pushed a pretty raw fix for this issue. It will fire exceptions but at least it will not break the file. Unfortunately I don't have time to investigate into this in more detail today :( If you encounter exceptions when clicking somewhere in the lower end of the document closing and reopening of the document helps. |
@Yserz That didn't fix it. I have the same issue. |
Same issue, I tested a JSON file. It is really weird. |
Have same issues with version 0.10.3, on Java file. |
Could be related to this too: #111 |
Smth new here? |
This happens at least on PHP projects with the latest version and not always.
Steps to repro:
You are likely to end up a file that displayed with broken indentations.
The text was updated successfully, but these errors were encountered: