Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Column selection #46

Open
austincondiff opened this issue Aug 30, 2024 · 0 comments
Open

✨ Column selection #46

austincondiff opened this issue Aug 30, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@austincondiff
Copy link
Contributor

austincondiff commented Aug 30, 2024

Description

We need to implement column selection (also known as block selection or rectangular selection) in CodeEdit, allowing users to select text in a columnar fashion. This feature is particularly useful for editing structured text, such as code, where the same changes need to be applied to multiple lines simultaneously.

Triggering Column Selection:

  • Users should be able to initiate column selection by either
    • holding down the ⌥ Option key and dragging the mouse or
    • using the keyboard with ⇧ Shift + ⌃ Control + ▲ up/▼ down arrow keys

Visual Indication:

  • There should be a clear visual indication that column selection mode is active by changing the cursor to crosshairs

Editing Behavior:

  • When text is typed while in column selection mode, it should replace the selected text in all lines within the selection.
  • Deleting should remove the selected block of text across all lines.
  • Navigating and selection with the arrow keys should apply to each cursor as expected, including with modifier keys held

Clipboard Support:

  • Copying and pasting should respect the column selection, allowing users to copy a block of text and paste it in a similar columnar fashion.

Compatibility:

  • Ensure compatibility with existing selection behaviors and other editor features, such as multiple cursors.

Additional Context

This feature is common in many text editors and IDEs, such as Visual Studio Code, Sublime Text, and JetBrains IDEs, and can significantly enhance productivity, especially when working with large codebases.

Possible Challenges

  • Ensuring that column selection works seamlessly with all supported languages and file types.
  • Managing edge cases, such as selections that start or end in the middle of a tab character or mixed tab/space indentations.

References

Tasks

  1. Implement the core column selection functionality.
  2. Change cursor when ⌥ is held and over editor to indicate column selection mode.
  3. Ensure clipboard operations work with column selections.
  4. Test for compatibility with other editor features and languages.
  5. Document the feature in the CodeEdit user guide.

Screenshots

Screen.Recording.2024-08-29.at.10.47.45.PM.mov
@austincondiff austincondiff added the enhancement New feature or request label Aug 30, 2024
@austincondiff austincondiff moved this from 🆕 New to 📋 Todo in CodeEdit Project Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 📋 Todo
Development

No branches or pull requests

1 participant