Skip to content
This repository was archived by the owner on Apr 16, 2026. It is now read-only.
This repository was archived by the owner on Apr 16, 2026. It is now read-only.

Feature request: Cut/copy line when selection is a cursor #2382

@njx

Description

@njx

In many editors, when the selection is a cursor (or multiple cursors), copy and cut operate on the line(s) containing the cursor(s). This is a very handy feature for quickly moving code around, and we get this request a lot in Brackets.

Is this possible to implement in CodeMirror? I don't fully understand how CM manages the clipboard operations (since I know you can't directly mess with the clipboard from JS), but my understanding is that it's managed via the hidden input field. Would it be possible to make it so that when the selection is a cursor/cursors, the hidden input field contains the lines containing the cursors and selects them? Or would that mess up other logic that relies on the input field?

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