Menu

#2514 Options / Open *.properties opens same file multiple times

Bug
closed-fixed
nobody
5
21 hours ago
5 days ago
Piotr Fusik
No

Environment:

  • SciTE 5.6.4 64-bit full
  • Windows 11

Steps to reproduce:

  • Options / Open cpp.properties
  • Options / Open cpp.properties
    (same problem with files other than "cpp")

Expected:

  • cpp.properties open in one tab

Actual:

  • New tab open on each action

Discussion

  • Neil Hodgson

    Neil Hodgson - 4 days ago

    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?

     

    Related

    Bugs: #2476

  • Neil Hodgson

    Neil Hodgson - 4 days ago
    • labels: SciTE --> SciTE, win32
     
  • Piotr Fusik

    Piotr Fusik - 4 days ago

    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.

     
  • Piotr Fusik

    Piotr Fusik - 4 days ago

    "Open Global Options File" is also affected. "Open User Options File" is not.

     
  • Neil Hodgson

    Neil Hodgson - 4 days ago

    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.

     
  • Piotr Fusik

    Piotr Fusik - 4 days ago

    Yeah, I can reproduce the issue by running "\progra~1\wscite\scite" on the Windows command prompt.

     
  • Neil Hodgson

    Neil Hodgson - 3 days ago
    • status: open --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 3 days ago

    Committed fix [02f9a0] which calls GetLongPathNameW to change the module path to its long form.

     

    Related

    Commit: [02f9a0]

  • Neil Hodgson

    Neil Hodgson - 21 hours ago
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.