equalsraf / neovim-qt

Neovim client library and GUI, in Qt5.
https://github.com/equalsraf/neovim-qt/wiki
ISC License
1.84k stars 172 forks source link

Reevaluate Underline Color Logic #1011

Open jgehrig opened 2 years ago

jgehrig commented 2 years ago

See comments: https://github.com/equalsraf/neovim-qt/pull/856#issuecomment-1213320100

Related:

929

851

856

FYI @shatur

jgehrig commented 2 years ago

@Shatur Sorry for the slow response...

I can't reproduce the behavior you've described. From my observation the new underline color logic is being used.

From a quick read of the code, the new logic is in effect:

QPen ShellWidget::getSpecialPen(const Cell& cell) noexcept
{
    QPen pen;
    if (cell.GetSpecialColor().isValid()) {
        pen.setColor(cell.GetSpecialColor());
    } else if (cell.GetForegroundColor().isValid()) {
        pen.setColor(cell.GetForegroundColor());
    } else {
        pen.setColor(foreground());
    }

    pen.setWidthF(qMax(1.0, m_cellSize.height() / 16.0));

    return pen;
}

It is quite possible I've missed a corner case though :)

Can you provide an example "bad-render" case using nvim-qt -- -u NONE?

Let's make sure we're both using the same colorscheme and scenario. A markdown file with heading or :help command are good ways to force an underline render.

Hopefully using an identical scenario will help us figure this out once and for all :)

Shatur commented 2 years ago

@jgehrig consider the following commands:

:lua vim.api.nvim_set_hl(0, 'SpellBad', { fg = 'green', underline = true })
:hi SpellBad

Expected behavior (Neovide): изображение Current behavior (Neovim Qt): изображение

jgehrig commented 2 years ago

@Shatur

I cannot reproduce that issue, here is what I see with the latest version of neovim-qt: image

Is it possible you're running an older version?

Shatur commented 2 years ago

@jgehrig I use 0.2.17. I can reproduce it with nvim-qt -- -u NONE using the commands above.

jgehrig commented 2 years ago

I can reproduce this issue when ext_linegrid in ~/.config/nvim-qt/nvim-qt.conf is disabled:

[General]
ext_linegrid=false
...

Can you try enabling the new rendering protocol ext_linegrid=true?

Shatur commented 2 years ago

Can you try enabling the new rendering protocol ext_linegrid=true?

Right, with ext_linegrid=true it works as expected.