Skip to content

Selection behavior in Documents dialog when closing documents #9482

Description

@nmatt

Apache NetBeans version

Apache NetBeans 30

What happened

In the Documents dialog (Window > Documents...), when closing a document (using the Delete key or Alt+L), the selection in the Documents list moves up to the document above the one that was closed. This is unusual and inconsistent with how deletion works in file managers and in the Projects and Files pane. It makes it less convenient to quickly close a number of adjacent documents by repeatedly hitting Delete, because you either have to start from the bottom, or re-navigate to the next document in-between, or first multi-select the documents to be closed.

=> Change the behavior so that when closing a document, the selection moves to the document after that (if any). This means that visually the selection stays in place, as the documents listed after the one having been deleted move up.

Language / Project Type / NetBeans Component

No response

How to reproduce

  1. Open a bunch of files in the editor.
  2. Invoke Windows > Documents... (or Shift+F4).
  3. Press arrow-down to move to some document in the middle of the list.
  4. Press Delete (or Alt+L) to close the selected document.
    => The previous document in the list becomes selected instead of the next document.

Did this work correctly in an earlier version?

No / Don't know

Operating System

Windows

JDK

21

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

No response

Are you willing to submit a pull request?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:bugBug report or fixneeds:triageRequires attention from one of the committers

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions