@PeterJones said in Default LF and not CRLF:
only one instance (in theory, the last to close) has permission to write the settings to disk.
that (or my original phrasing of “in theory, the first instance”) are both technically right, and practically wrong. it’s actually very confusing, and it depends on which configuration file you are talking about.
I took a portable, and put it into multi-instance mode. then opened two instances. Instance 1, I set to Dark Mode + Small Toolbar Icons, instance 2 I set to Light Mode + Big Toolbar Icons. I closed Instance 2, and looked, and saw that config.xml was saved, but session.xml did not save. then I closed Instance 1, and saw that config.xml was saved again and session.xml was saved this time. So in this run, both were able to write to config.xml, but only the first instance was able to write to session.xml. When I ran one instance of Notepad++ after this, it was in Dark Mode + Small Toolbar, which shows that instance 1 definitely “won” for the config.xml
I started a new pair of instances – this time, they both started out in Dark Mode + Small Icons. Then I changed Instance 1 to Light Mode + Small Icons, and changed Instance 2 to Dark Mode + Big Icons. I closed instance 1, and saw that both config.xml and session.xml were saved. Then I closed instance 2 and saw that config.xml was saved but session.xml was not. This seems to confirm my working mental model. When I started one instance after this, it was Dark Mode + Big Icons, which was the instance 2 setting, and thus the last one closed “won” for config.xml again.
Hence, the way I will phrase things, at least based on my best understanding for now:
When multiple instances of Notepad++ are open, each will write its config.xml when it exits, so the last instance closed is the one whose config.xml will “win”. However, only the first instance of Notepad++ in multi-instance mode gets permission to write to session.xml, so only that first instance will ever save its session.