When I start NetLogo 7.1.0-alpha1 for the first time and add a new procedure in the code tab,
the first line after to or to-report is not indented, even though the autoindent preference is on.
Switching it off and on again restores the indentation functionality.
After closing NetLogo and starting it again, it still remembers the setting, but after a fresh start of the computer the wrong behavior is back.
This happens on multiple Windows machines were I am testing/using the preview version.
It might be a Windows-specific issue.
Both machines are 64-bits Windows.
They are private machines (so no company policies) with local users.
Could there be interference between preferences?
For completeness sake, I include screenshots of general and code preferences (the other are definitely still installation default):
I’m also on 64-bit Windows, so that should be fine. I don’t have the ability to start from a fresh machine, but here’s my process for attempting to replicate the behavior:
Delete the NetLogo preferences in the Registry Editor (HKCU\Software\JavaSoft\Prefs\org\nlogo\Net/Logo)
Open NetLogo 7.1.0-alpha1
Navigate to the Code tab
Type to test and press Enter
After completing these steps, the caret is on the second line and indented by one level, as expected. Could you also try these steps to see if the behavior is any different than when you get a truly fresh start?
The behavior is the same after removing the indicated registry entry (with subkeys).
All other preferences seem to work.
To clarify, the preference (and registry key) are remembered correctly, but NetLogo does not always follow the preference.
While further testing this issue, I found some peculiarities:
the problem occurs only when starting NetLogo (7.1.0 alpha 1) the first time after starting Windows
it does not make a difference whether this is a cold start (Shut Down followed by power-on) or a Restart
after logging off and on again, NetLogo does indentation correctly
the second time I start NetLogo it does indentation correctly most of the time, but in 5-10% of the tests it did not indent correctly after a second (or later) start of NetLogo
it seems like the problem is not completely reproducible when “Show auto-complete popup while typing” is on; I have it switched off normally
out of some 40 tests, 2 times indentation was correct immediately (when the auto-completion popup was enabled)
So, the problem is not quite reproducible.
As the work-around is easy (just toggle the preference twice), maybe you should not spend too much time on it.
I had hoped it was something simple.
Thank you for the detailed report, I agree that it sounds like some weird interactions between preferences. If one of us is able to reproduce it, we’ll look into it further.