Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Characters disappear when NERDTree pane opens #255

Closed
cyril-s opened this issue Sep 8, 2020 · 5 comments
Closed

Characters disappear when NERDTree pane opens #255

cyril-s opened this issue Sep 8, 2020 · 5 comments

Comments

@cyril-s
Copy link

cyril-s commented Sep 8, 2020

Describe the bug
Some characters disappear when toggling NERDTree pane open, notably lines where NERDTree displays directories are affected.

nvim-gtk_bug

Technical information:

  • OS: Debian sid
  • Neovim version: NVIM v0.4.4
  • Neovim-Gtk build version: 925382a
  • Build dependencies
||/ Name                       Version       Architecture Description
+++-==========================-=============-============-===================================================
ii  libatk1.0-dev:amd64        2.36.0-2      amd64        Development files for the ATK accessibility toolkit
ii  libcairo2-dev:amd64        1.16.0-4      amd64        Development files for the Cairo 2D graphics library
ii  libgdk-pixbuf2.0-dev:amd64 2.40.0+dfsg-5 amd64        GDK Pixbuf library (development files)
ii  libglib2.0-dev:amd64       2.64.4-1      amd64        Development files for the GLib library
ii  libgtk-3-dev:amd64         3.24.22-1     amd64        development files for the GTK library
ii  libpango1.0-dev:amd64      1.46.1-1      amd64        Development files for the Pango
  • Rustc version: rustc 1.46.0 (04488afe3 2020-08-24)

Reverting libpango to 1.44 fixes the issue

@jacobmischka
Copy link
Contributor

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).

@pitbuster
Copy link

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

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

@jacobmischka
Copy link
Contributor

I haven't, sorry.

@theHamsta
Copy link

theHamsta commented Dec 7, 2020

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.

@cyril-s
Copy link
Author

cyril-s commented Jan 25, 2021

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

@cyril-s cyril-s closed this as completed Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants