Skip to content

Unsaved files should not be allowed to have the same name #9119

@sasumner

Description

@sasumner

Description of the Issue

Using the File > Rename feature on an unnamed/unsaved document allows something more memory-jogging than new 4 or new 2 on a tab.

However, currently two or more untitled documents may be given the same name, without error.

This is problematic for at least one circumstance (described below), but there may be others, and really, is it helpful to have two tabs with the exact same temporary name?

Steps to Reproduce the Issue

  1. Press Ctrl+n twice to create two new documents entitled new 1 and new 2.
  2. Put the text abc in new1 and the text abcdef in new 2.
  3. Right-click the new1 tab and choose Rename and specify foo as the new name.
  4. Similarly, Right-click the new2 tab and choose Rename and specify foo as the new name.
  5. Make the first foo tab the active one by clicking the tab.
  6. Run a simple Find All in All Opened Documents search for abc and observe:
    image
  7. Verify that the leftmost foo tab is still the active one.
  8. Double-click abcdef in the Find result window.

Expected Behavior

The second (rightmost) foo tab will be made active to show the abcdef match.

Actual Behavior

The second (rightmost) foo tab was NOT made active to show the abcdef match.
The user is still viewing the first (leftmost) foo tab and only sees abc.

See Also

The comment here: #9115 (comment)

Debug Information

Notepad++ v7.9.1 (64-bit)
Build time : Nov 2 2020 - 01:07:46
Path : C:\.......\npp.7.9.1.portable.x64\notepad++.exe
Admin mode : OFF
Local Conf mode : ON
OS Name : Windows 10 Enterprise (64-bit)
OS Version : 1809
OS Build : 17763.1518
Current ANSI codepage : 1252
Plugins : mimeTools.dll NppConverter.dll NppExport.dll

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions