Giter Site home page Giter Site logo

Comments (10)

kyx0r avatar kyx0r commented on June 18, 2024

I am not currently using fbpad, but I tested it there some time and same thing happens.

from neatvi.

kyx0r avatar kyx0r commented on June 18, 2024

Okay yes I know kinda understand what the problem is, the last visible character is combining, simply omitting the last character solves the problem, so actually this is a bug where vi tries to render a few bytes more than there is on the screen. I think Nextvi will have this bug fixed soon, working on it now that I actually found the cause.

from neatvi.

kyx0r avatar kyx0r commented on June 18, 2024

Ok, why is the combining character implemented like that? ren_placeholder() is bugged and will return more characters than needed into term_commit() resulting in this incorrect string rendering.

Take a look at my commit 8f788fede224a1e60d0abf7eabf2565b74f0d679
with a proposed fix, it works just fine. When we try to render the last possible comb character we must return only
1 byte, so that there is no excess spill.

from neatvi.

kyx0r avatar kyx0r commented on June 18, 2024

Ok well, it fixed the problem on one terminal but still does not work in tty, it seems like the terminal decides to render the combining characters however the hell it wants? Like in tty it thinks that the special character hexed 0640 is the width of 2 chars? As a result it completely throws off the result and cursor position mismatches the actual character.

from neatvi.

kyx0r avatar kyx0r commented on June 18, 2024

Ok, I think it makes sense better now. It's like that because tty does not actually even try to combine the characters, so it's valid that it ends up being 2 chars. Nonetheless this is still utterly wrong. Is there a way to figure out if terminal can combine the chars?

from neatvi.

kyx0r avatar kyx0r commented on June 18, 2024

I've just checked fbpad again and it works correctly without a patch there. That just tells me that st terminal simply does not render combining chars correctly if it gets a combining char on the boundary, ie the last visible col. The patch worked because nextvi did essentially what the terminal should of done.

What should I do Ali? Report it to Hiltjo in hopes it gets fixed in the terminal or keep the patch in vi?

from neatvi.

kyx0r avatar kyx0r commented on June 18, 2024

I think we can make an ex option to disable the dialectical mark, so that users from tty don't get all the junk extra characters, or even just test using istty and set the variable automatically?

from neatvi.

aligrudi avatar aligrudi commented on June 18, 2024

from neatvi.

kyx0r avatar kyx0r commented on June 18, 2024

from neatvi.

aligrudi avatar aligrudi commented on June 18, 2024

from neatvi.

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.