Coder Social home page Coder Social logo

Copy-pastable line wrap about termbox-go HOT 2 CLOSED

tigrawap avatar tigrawap commented on June 2, 2024
Copy-pastable line wrap

from termbox-go.

Comments (2)

nsf avatar nsf commented on June 2, 2024

It's not possible in termbox. Just because of abstractions used. Termbox doesn't preserve info about lines of text as it's just an array of 2d cells. And I believe similar libs have a similar problem, but maybe I'm wrong about that.

Solution: avoid using terminals. Terminals suck.

from termbox-go.

scrouthtv avatar scrouthtv commented on June 2, 2024

Sorry for the late answer, but let me get this right:
You want to be able to select a multi-line text but not the entire lines and you don't want the line breaks to be in the selection?
So this is your problem:
termselection

If you're still looking for a solution, here's something I hacked together:
clipboard

Here is the source file in case you're interested: clipboard.go.txt

This basically consists of three things:

  • Any mouse press is recorded and added to a selection rectangle.
  • The selection rectangle is highlighted in the inverted style.
  • When the user presses the enter key, that region is copied to the clipboard.

With this technique, you still cannot intercept C-Ins (although you can intercept C-S-c. Also, keep in mind that what I'm doing here is not a real terminal selection but just a highlighted area.

Let me know if this helped you!

from termbox-go.

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.