Cut the current line when no text is selected in the code editor
Pre-submit Checks
- I have searched Warp feature requests and there are no duplicates
- I have searched Warp docs and my feature is not there
Describe the solution you'd like?
In the code editor, pressing the cut shortcut with no text selected should cut the current line, the way VS Code and the JetBrains IDEs do.
The cut text should then behave like a line-wise copy when it is pasted: it goes back as a whole line above the cursor's line rather than at the caret.
This is the cut counterpart of #15849, which covers copy.
Is your feature request related to a problem? Please describe.
Yes. A cut with an empty selection in the code editor currently does something a user is unlikely to want. CodeEditorModel::cut is copy followed by backspace, so with nothing selected it writes empty content to the clipboard and deletes the single character before the caret. Whatever the clipboard held is gone, and a character disappears from the buffer.
Line-wise cut is a near-universal expectation from other editors, so the present behavior reads as a gap rather than a deliberate choice.
Additional context
Once the copy behavior requested in #15849 lands, copy will be line-wise while cut is not, which makes the asymmetry easier to run into.
The mechanism needed for this already exists in the repository. The copy side can record a line-wise entry through VimRegisters::write_to_register on the + register, and the paste side reads it back with read_from_register, which compares its stored entry against the live system clipboard and falls back to a char-wise paste when they differ. A line-wise cut would reuse those same two calls and add the line deletion.
One point worth settling during triage: whether this should apply only to the standalone code editor, as the copy change does, or to more surfaces. CodeEditorView is embedded in AI blocks, diff views, the requested-command view and the CLI subagent block, and those surfaces rely on the editor emitting CodeEditorEvent::CopiedEmptyText so the parent view can act on an empty-selection copy instead.
Operating system (OS)
Cross-platform
How important is this feature to you?
2
Warp Internal (ignore) - linear-label:39cc6478-1249-4ee7-950b-c428edfeecd1
None
Source: warpdotdev/warp