Coder Social home page Coder Social logo

Comments (5)

theHamsta avatar theHamsta commented on August 17, 2024 1

I only had a short browse around the code base. What makes me a bit suspicious is this double_width. Could it be that neovim-gtk does not support triple-width, 4-byte characters? But it's only a guess since I didn't review it in detail It's just for ligatures

#[derive(Clone)]
pub struct Cell {
    pub hl: Rc<Highlight>,
    pub ch: String,
    pub dirty: bool,
    pub double_width: bool,
}

impl Cell {
    pub fn new_empty() -> Cell {
        Cell {
            hl: Rc::new(Highlight::new()),
            ch: String::new(),
            dirty: true,
            double_width: false,
        }
    }

    pub fn clear(&mut self, hl: Rc<Highlight>) {
        self.ch.clear();
        self.hl = hl;
        self.dirty = true;
        self.double_width = false;
    }
}

one usage

        for (cell_idx, cell) in line.line.iter().enumerate() {
            if cell.double_width {
                continue;
            }

            if !cell.ch.is_empty() {
                line_str.push_str(&cell.ch);
            } else {
                line_str.push(' ');
            }
            let len = line_str.len() - byte_offset;

            for _ in 0..len {
                cell_to_byte.push(cell_idx);
            }

            let next = style_attr.next(byte_offset, byte_offset + len, cell, hl);
            if let Some(next) = next {
                style_attr.insert_into(&attr_list);
                style_attr = next;
            }

            byte_offset += len;
        }

Could also be that those are double_with ligatures to be drawn. neovim-gtk has at least two character ligatures as -> . Should take a more detailed look.

  let len = line_str.len() - byte_offset;

But I suppose it has to be a byte != str.len issue.

from neovim-gtk.

jacobmischka avatar jacobmischka commented on August 17, 2024

I'm willing to bet #254 is related to this as well. I haven't dug into it yet, but I hope to soon (maybe not until hacktoberfest, though).

from neovim-gtk.

pitbuster avatar pitbuster commented on August 17, 2024

Hi @jacobmischka, have you had any chance to look into this?

I can help if needed (by running test, debugging, etc).

from neovim-gtk.

jacobmischka avatar jacobmischka commented on August 17, 2024

I haven't, sorry.

from neovim-gtk.

cyril-s avatar cyril-s commented on August 17, 2024

After system upgrade the issue is fixed for me

cairo 1.17.4-3
glib2 2.66.4-2
gtk3 1:3.24.24-2
pango 1:1.48.1-1

from neovim-gtk.

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.