Coder Social home page Coder Social logo

Comments (3)

rhysd avatar rhysd commented on June 17, 2024 2

This was implemented at 7de8e98.

Clipboard register "* is supported. For example, paste system clipboard text to Vim with "*p or :put *, and copy text in Vim to system clipboard with "*y or :yank *. If you want to synchronize Vim's clipboard with system clipboard, :set clipboard=unnamed should work like normal Vim.

tmp

from vim.wasm.

rhysd avatar rhysd commented on June 17, 2024

Yeah, with tiny feature, Vim has its internal clipboard and it is not synchronized. I want to try this after enabling larger feature.

from vim.wasm.

rhysd avatar rhysd commented on June 17, 2024

After small investigation, synchronizing clipboard would not fit to this app because

  • Clipboard API is not always available. Some browsers don't support it and a user may not permit to access to clipboard (read/write)
  • Clipboard text may be sometimes big. In the case, sending the text to main thread at every yanking would be overhead. It requires UTF-8 to UTF-16 conversion and serialization for inter-threads communication (clipboard access is available on main thread only)

Considering these points, I want to implement clipboard support only for "* clipboard register.

  • When user explicitly paste something from clipboard register such as "*p, it reads clipboard in main and Vim pastes the text in worker
  • When user explicitly yank something to clipboard register such as "*yy, Vim sends the yanked text to main and main will write it to clipboard

Note that we need to consider the case where user does not permit access to clipboard. In the case this feature is simply disabled.

from vim.wasm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.