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
Phantom changes to file preferences: word wrap preference altered when file is open, reverted when closed #430
Comments
Reproduced. This looks like a fun one .. Thanks @ervumlens |
I'm glad I could help narrow it down. This was the first problem I ran into with Komodo. I noticed Komodo forum posts describing similar problems, so I figured there was no point in logging a bug until I had something useful to share. Regarding the intentional, one-time preference change: I hope you'll agree that the typical user doesn't expect this to happen. Would you consider adding a notification or similar to tell the user "Yes, we just turned on word wrap. No, it's not a bug," to mitigate some of the surprise? |
@cgchoffman I saw you were looking at this the other day, could you add your findings to the ticket? |
@ervumlens I agree a notification would make a lot of sense. |
I didn't find much to add. I was messing around, trying to find a way to block that code if the file wasn't new to Komodo but I suspect that that check occurs before that code is hit any way. I didn't have tons of time to look into this. |
For performance reasons we automatically turn on word wrap for new files when lines of length 2000+ are detected. The problem is that "File Properties" is reporting two different values: one when the file is open, and another when the file is closed. Need to investigate further. |
Hello, I'm extremely grateful to you for all you have done, please read my message for you here http://fast.softwarevalueoptimisation.com/e4qxfxuh Warmest, tony.attwood@ntlworld.com |
Hello, |
Hey, I came across that interesting stuff and I guess it's something really crazy, just take a look http://venue.oleymi.com/e4mfu Yours, tony.attwood |
Hello, I've watched a really great movie a couple of days ago, it inspired mea lot, you may watch the trailer here http://gyprywohi.idanz.org/e4tbh Speak to you later, tony.attwood |
Spoiler alert: I include the lines of code that cause the problem (at least in part).
Also: This may be related in a roundabout way to #175, although the symptoms are different.
Problem
If a file has long lines, its file-level preference for word wrapping is changed whenever it is opened. Because it's changed with every open, that file will always open with word wrap enabled no matter what preferences are set, no matter where they are set.
<blink>The problem is easy to reproduce</blink> But because word-wrap bug reports are sometimes spurious, I made sure to include all the obvious gotchas here.
Steps to Reproduce — Part 1
Expected
Word wrapping is disabled both on the screen and in the file preferences.
Actual
Word wrapping is enabled both on the screen and in the file preferences. But hey, who cares? It's a new file. 🎸
Steps to Reproduce — Part 2
Expected
Word wrapping is disabled.
Actual
Word wrapping is, as expected, disabled. 👍
Steps to Reproduce — Part 3
Expected
Word wrapping is disabled both on the screen and in the file preferences.
Actual
Word wrapping is enabled both on the screen and in the file preferences. 👎 We're not a new file any more.
Steps to Reproduce — Part 4
Expected
Word wrapping is disabled both on the screen and in the file preferences.
Actual
Word wrapping is enabled both on the screen and in the file preferences. 👎 We're not a new file and we have a preference set.
Code
koDocument.py#L644-L649
This code is always hit when opening a long-lined file, despite promises to the contrary:
Some strategic logging shows this to be the case.
The guard code (not shown) isn't working. As the comments here and elsewhere suggest, the preference change should not occur with a file that has been opened previously.
P.S. I just found another use-case with a similar problem, but not with long lines (I'll comment about it below if I can find a visible error). I suspect there's something broadly wrong with this code.
The text was updated successfully, but these errors were encountered: