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

Restore copy behavior in Vim keymap#1685

Open
Bigsunnyboy wants to merge 1 commit into
BoostIO:masterfrom
Bigsunnyboy:fix-vim-ctrl-c-copy
Open

Restore copy behavior in Vim keymap#1685
Bigsunnyboy wants to merge 1 commit into
BoostIO:masterfrom
Bigsunnyboy:fix-vim-ctrl-c-copy

Conversation

@Bigsunnyboy
Copy link
Copy Markdown

@Bigsunnyboy Bigsunnyboy commented May 11, 2026

Summary

  • add a shared CodeMirror Vim Ctrl-C handler that runs the browser copy command for Vim editors
  • attach it to both cloud editor configurations so selected text can be copied on Windows/Linux while preserving CodeMirror's normal handling

Fixes #773.

Verification

  • npm ci --ignore-scripts --prefer-offline
  • npx eslint src/cloud/lib/editor/vimKeyMap.ts src/cloud/components/Editor/index.tsx src/cloud/lib/hooks/editor/docEditor.ts --ext .ts,.tsx
  • npx tsc --noEmit --pretty false

Notes

  • Not manually verified in Electron on Windows/Linux.

IssueHunt Summary

Referenced issues

This pull request has been submitted to:


CodeMirror's Vim keymap consumes Ctrl-C on Windows and Linux before the editor can copy selected text. The fix adds a small shared extraKeys handler that invokes the browser copy command for Vim editors and then returns CodeMirror.Pass so CodeMirror can continue its normal handling.

Constraint: Keep the change scoped to the existing CodeMirror editor configuration

Rejected: Rework user-customizable keybindings | larger UI and settings change than the bounty issue requires

Confidence: medium

Scope-risk: narrow

Directive: Keep this handler attached to every cloud editor configuration that supports the Vim keymap

Tested: npx eslint src/cloud/lib/editor/vimKeyMap.ts src/cloud/components/Editor/index.tsx src/cloud/lib/hooks/editor/docEditor.ts --ext .ts,.tsx

Tested: npx tsc --noEmit --pretty false

Not-tested: Manual Windows/Linux Electron clipboard flow
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 11, 2026

CLA assistant check
All committers have signed the CLA.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't use ctrl-c to copy text in Vim binding mode

2 participants