Default LF and not CRLF
-
Friends,
I set the default of LF instead of CR LF, it works in that instance, but if I open a new instance of Notepad++, it changes back to CRLF.
No way to keep it LF always?
Thanks
-
@flaviozluca said in Default LF and not CRLF:
I open a new instance of Notepad++, it changes back to CRLF.
Notepad++ only saves settings to disk when it exits. Thus, if you don’t exit after you make a settings change, the new instance cannot know about that settings change.
Also, if you have more than one instance open, only one instance (in theory, the last to close) has permission to write the settings to disk. Thus, if you currently have two or more instances open, you’ve got no real way of knowing which has permission to write settings to disk. If you want to make a permanent change to settings when you have multiple instances open, the best thing to do is to exit all instances, start one new instance, make the settings change and exit (to write the settings to disk), then from then on, new instances will make use of the new setting.
(Handling settings-changes is one of the places where multi-instance doesn’t work great.)
-
@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, butsession.xml
did not save. then I closed Instance 1, and saw thatconfig.xml
was saved again andsession.xml
was saved this time. So in this run, both were able to write toconfig.xml
, but only the first instance was able to write tosession.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 theconfig.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
andsession.xml
were saved. Then I closed instance 2 and saw thatconfig.xml
was saved butsession.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” forconfig.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 whoseconfig.xml
will “win”. However, only the first instance of Notepad++ in multi-instance mode gets permission to write tosession.xml
, so only that first instance will ever save its session.