Skip to content

Project Workspace "Save a Copy As" confuses the GUI's shown workspace name #13135

@pryrt

Description

@pryrt

Per discussion in #13131, there is a definite bug that was brought up, and should be addressed, regardless of the other feature concerns in that previous issue.

Description of the Issue

If you use the Project Panel Workspace feature of Save a Copy As, it does not behave as expected: it shows that the workspace has changed name (it shouldn't) but is actually still using the old copy of the workspace (which it should do).

Expected Behavior

When you Save a Copy As, there should be a new workspace file created, and Notepad++ should still continue to use the old workspace file and name, and the GUI should display that it's still using the old workspace name.

Actual Behavior

When you Save a Copy As, there is be a new workspace file created (correct), and Notepad++ should still continue to use the old workspace file (correct) and name, but the GUI displays that it's using the new name when it should still show the old name (bug).

If you make a change to the active project (for example, add or remove a file), then save that project's workspace, the GUI suddenly shows the old name again (which it should have been showing all along)

Steps to Reproduce (STR)

  1. View > Project Panels > Project Panel 1
  2. Workspace > New Workspace to clear any existing workspace
  3. Workspace > Add New Project: SubProject
  4. Workspace > Save: one.wkspc => contents of one.wkspc are
    <NotepadPlus>
          <Project name="SubProject" />
    </NotepadPlus>
    
  5. Workspace > Save As: two.wkspc
    • GUI says two.wkspc is active, as it should
  6. SubProject > Add File(s): change.log and readme.txt
  7. Workspace > Save => contents of two.wkspc are now:
    <NotepadPlus>
        <Project name="SubProject">
            <File name="change.log" />
            <File name="readme.txt" />
        </Project>
    </NotepadPlus>
    
  8. Workspace > Save a Copy As: three.wkspc =>
    • Expectation: GUI will still say two.wkspc is active
    • Actual behavior: GUI now says three.wkspc is active. However, it's worse than that. Continuing the experiment:
  9. SubProject > Add File(s): license.txt
  10. Workspace > Save =>
    • Unexpected: The GUI now says two.wkspc is active.
    • Contents of two.wkspc:
      <NotepadPlus>
          <Project name="SubProject">
              <File name="change.log" />
              <File name="readme.txt" />
              <File name="license.txt" />
          </Project>
      </NotepadPlus>
      
    • Contents of three.wkspc:
      <NotepadPlus>
          <Project name="SubProject">
              <File name="change.log" />
              <File name="readme.txt" />
          </Project>
      </NotepadPlus>
      

Thus, for step 9-10, it was obviously actually correctly working with two.wkspc, but it claimed to be working with three.wkspc.

Conclusion: Save a Copy As is correctly saving a copy and keeping the old version active, but it incorrectly shows the name as the new version of the file, until the workspace is saved again.

Debug Information

Notepad++ v8.4.9   (64-bit)
Build time : Jan 27 2023 - 03:11:16
Path : C:\usr\local\apps\npp\npp.8.4.9.fresh\notepad++.exe
Command Line : 
Admin mode : OFF
Local Conf mode : ON
Cloud Config : OFF
OS Name : Windows 10 Enterprise (64-bit) 
OS Version : 20H2
OS Build : 19042.2486
Current ANSI codepage : 1252
Plugins : 
    mimeTools (2.9)
    NppConverter (4.5)
    NppExport (0.4)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions