I have not been able to reproduce this either on my normal Windows 10 system or on a Windows 11 VM. However, my setups are generally very simple placing SciTE in local NTFS disk directories like 'C:\bin\scite'. The path comparison performs a CompareStringW(LOCALE_SYSTEM_DEFAULT, NORM_IGNORECASE, ... on the new and current buffer path. The current buffer path would have previously been processed with GetLongPathNameW to force case to match on-disk (in case user entered 'uNeXpEcTeD_cAsE').
There was a bug [#2476] a few versions back but that should be fixed.
Is there anything less common for your setup like being on a remote filesystem?
It's a Windows 11 Pro setup on a laptop. SciTE is in "C:\Program Files\wscite", so an all-ASCII path. Windows settings are:
Windows display language: English
Country or region: Poland
Now I see that it only reproduces if I launch SciTE from within my file manager ZTreeWin (https://ztree.com), version 2.4.217. So, first I press E on a text file in ZTreeWin. Then I can open cpp.properties many times. I'm unable to reproduce this by launching SciTE from the command prompt with a file path. If I open SciTE first via a shortcut, then use E from ZTreeWin, there is no issue.
ZTreeWin is closed-source, but I can try to ask the author how it launches the editor. Alt+F10 opens its settings and the only editor configuration is the path: "C:\Program Files\wscite\SciTE.exe". ZTreeWin is installed in "C:\Program Files\ZTree", if that matters.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think the most likely direction is that there is some use of shortened paths so SciTE is using something like "C:\Progra~1\wscite\" as the basis for the properties file paths like "C:\Progra~1\wscite\cpp.properties" then calling GetLongPathNameW on that to assign the full path "C:\Program Files\wscite\cpp.properties" to the buffer. Then the second call sees no match between "C:\Progra~1\wscite\cpp.properties" and the buffer paths so it opens a new buffer.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have not been able to reproduce this either on my normal Windows 10 system or on a Windows 11 VM. However, my setups are generally very simple placing SciTE in local NTFS disk directories like 'C:\bin\scite'. The path comparison performs a
CompareStringW(LOCALE_SYSTEM_DEFAULT, NORM_IGNORECASE, ...on the new and current buffer path. The current buffer path would have previously been processed withGetLongPathNameWto force case to match on-disk (in case user entered 'uNeXpEcTeD_cAsE').There was a bug [#2476] a few versions back but that should be fixed.
Is there anything less common for your setup like being on a remote filesystem?
Related
Bugs:
#2476It's a Windows 11 Pro setup on a laptop. SciTE is in "C:\Program Files\wscite", so an all-ASCII path. Windows settings are:
Now I see that it only reproduces if I launch SciTE from within my file manager ZTreeWin (https://ztree.com), version 2.4.217. So, first I press E on a text file in ZTreeWin. Then I can open cpp.properties many times. I'm unable to reproduce this by launching SciTE from the command prompt with a file path. If I open SciTE first via a shortcut, then use E from ZTreeWin, there is no issue.
ZTreeWin is closed-source, but I can try to ask the author how it launches the editor. Alt+F10 opens its settings and the only editor configuration is the path: "C:\Program Files\wscite\SciTE.exe". ZTreeWin is installed in "C:\Program Files\ZTree", if that matters.
"Open Global Options File" is also affected. "Open User Options File" is not.
I think the most likely direction is that there is some use of shortened paths so SciTE is using something like "C:\Progra~1\wscite\" as the basis for the properties file paths like "C:\Progra~1\wscite\cpp.properties" then calling
GetLongPathNameWon that to assign the full path "C:\Program Files\wscite\cpp.properties" to the buffer. Then the second call sees no match between "C:\Progra~1\wscite\cpp.properties" and the buffer paths so it opens a new buffer.Yeah, I can reproduce the issue by running "\progra~1\wscite\scite" on the Windows command prompt.
Then using
GetFinalPathNameByHandleW()or compare the file ids similar tostd::filesystem::equivalent()could fix the problem.https://learn.microsoft.com/en-us/windows/win32/api/winbase/ns-winbase-file_id_info
Committed fix [02f9a0] which calls
GetLongPathNameWto change the module path to its long form.Related
Commit: [02f9a0]