Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • GHex GHex
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 15
    • Issues 15
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • GHexGHex
  • Merge requests
  • !45

Make paste replace the selection

  • Review changes

  • Download
  • Patches
  • Plain diff
Open Jordan Christiansen requested to merge xordspar0/ghex:replace-selection into master May 25, 2023
  • Overview 1
  • Commits 1
  • Pipelines 1
  • Changes 1

I think this is ready, but I want more time to test before merging it. "More time" might be a week, since I'll be away from my computer this weekend.


When the user pastes, there's a matrix of possible things that can happen:

  • If some data is selected, limit the length of the paste to the selected area.

    • In insert mode, always delete the selection and replace it with the clipboard.
    • In non-insert mode, keep the payload length the same. If the clipboard is shorter than the selection, overwrite the beginning of the selection but leave the end the same. If the clipboard is longer than the selection, truncate the clipboard to the length of the selection.
  • If nothing is selected, don't restrict the length of the paste.

    • In insert mode, just insert the clipboard at the cursor position without replacing anything.
    • In non-insert mode, overwrite as many bytes as necessary to paste the clipboard.
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: replace-selection