The following is my workaround until Geany natively has this issue patched. I'm pasting it here for anyone who stumbles across this issue:

This workaround is because Geany uses LF line endings (not CRLF) for empty (0 byte) files. 0-byte files are what are ordinarily created when you create a new file via the Explorer context menu.

In C:\Windows\ShellNew\ I created these 5, identical, template files:

new_file.au3
new_file.bat
new_file.py
new_file.pyw
new_file.txt

(you can obviously create your own set of files that you need for your setup)

Each file contains just one Windows newline (CRLF) and nothing else.

Next, using regedit run as Administrator, I did the following, once for each of those 5 files above:

(Substitute "EXT" below with the real template file extension:)

  1. I created this key path (if it didn't already exist): HKEY_CLASSES_ROOT.EXT\ShellNew
  2. At that path I created the "String" value: "FileName"="new_file.EXT"
  3. If a value named "NullFile" pre-existed at the path I deleted it.

Now when I create a new file via the Explorer context menu and then open it with Geany, Geany will set the line endings to Windows, CRLF type.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <geany/geany/issues/1950/1599957323@github.com>