Skip to content

Large clipboard handling overhaul #405

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

Merged
merged 6 commits into from
Jun 10, 2025
Merged

Large clipboard handling overhaul #405

merged 6 commits into from
Jun 10, 2025

Conversation

lhecker
Copy link
Member

@lhecker lhecker commented Jun 3, 2025

  • Make each paste its own undo step.
  • Add a Paste input type, allowing us to...
  • Fill the internal clipboard with bracketed paste contents.
  • Abstract away clipboard handling into its own struct, so we can move
    the cut/copy/paste logic into TextBuffer, allowing us to...
  • Implement smart line-wise copy/paste via Ctrl+C/Ctrl+V.

Closes #286
Closes #305

Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial review

let clipboard = self.clipboard_mut();
clipboard.write(paste);
clipboard.mark_as_synchronized();
input_keyboard = Some(kbmod::CTRL | vk::V);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm not my favorite part of this PR!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can think of this as an action placeholder. If we add action types in the future this would read something like:

input_action = Some(Paste);

@lhecker lhecker merged commit c5d91f3 into main Jun 10, 2025
3 checks passed
@lhecker lhecker deleted the dev/lhecker/305-paste branch June 10, 2025 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Continuous paste operations will be cleared in one undo Ctrl+C/V should duplicate the current line and retain the horizontal cursor offset
2 participants