tim-harding / neophyte

A WebGPU rendered Neovim GUI
MIT License
141 stars 2 forks source link

Neophyte rendering issue #10

Closed Jezda1337 closed 9 months ago

Jezda1337 commented 9 months ago

after opening the neophyte, I ended up with this screen My config is basic; I installed the plugin and pasted the default config in the opts table.

Screencast from 2024-01-14 19-55-08.webm

tim-harding commented 9 months ago

Do you still encounter the issue with Noice?

  {
    'folke/noice.nvim',
    opts = {},
  },

It seems that due to fixing the float positioning, the message grid that you would ordinarily only see one line of at the bottom of the screen is covering everything. I didn't notice because Noice externalizes messages and suppresses the msg_set_pos event. Guess I should start testing with --clear to make sure my config isn't affecting things.

Jezda1337 commented 9 months ago

I don't have the Noice plugin, but I just added it as a dependency for your plugin, and here are the results, We're getting somewhere

Screenshot from 2024-01-14 22-52-41

tim-harding commented 9 months ago

It looks to me like the cell size is too wide. The cell size uses the max_width property from the metrics of the first loaded font. May I see what your config table looks like? Noice should no longer be required in the latest commits, by the way.

Jezda1337 commented 9 months ago

Sure, here is the plugin config

Screenshot from 2024-01-15 12-18-57

tim-harding commented 9 months ago

I've found a bug in the font loading library I'm using. Rather than returning None as expected when trying to load a font that doesn't exist, it instead returns some other font on the system. I'll take a look into either patching this library or trying another one.

Jezda1337 commented 9 months ago

I have just put some of my fonts in the fonts table and commented out fallback font with shorthand features or variants and it works better, there is still couple of issues like some of the colors are not correct and cursor is not as it should be it behaviors weird

Screenshot from 2024-01-15 21-53-24

tim-harding commented 9 months ago

The background color issue is related to the bg_override config entry. Since several people have copied the entire example config for testing, I changed it so that this setting only applies for transparent windows.

Without knowing too much about the specific cursor issues you were experiencing, I found a few things to work on based on your guifont setting. It seems I wasn't handling the blink rate correctly and it was flickering every frame. It should be correct now. Mind, you may have to adjust slightly for the expected appearance. 50ms blink rate is still very fast, but it may not be noticeable in a terminal GUI since the terminal overrides the cursor blinking and the blink settings act more like a boolean. You'll also want to add blinkwait to the insert mode settings, since the docs say not to blink the cursor if any of blinkwait, blinkon, or blinkoff are zero. The cursor color should be working better now as well. Did you notice any other issues I didn't mention?

Jezda1337 commented 9 months ago

Can you pls give me a hint where should I put this blink settings? Nah I didn't notice any other issue, only blinking speed as you describe it. I commented out bg_override table and colors are good now.

Jezda1337 commented 9 months ago

Bdw, I still need noice.nvim as dependencie, when I remove noice I get nothing on the screen, as shown in the video above.

tim-harding commented 9 months ago

In options.lua, you have

    guicursor =
    "n-v-c-sm:block-nCursor-blinkwait50-blinkon50-blinkoff50,i-ci-ve:ver25-Cursor-blinkon100-blinkoff100,r-cr-o:hor20",

I would recommend

    guicursor =
    "n-v-c-sm:block-nCursor-blinkwait200-blinkon200-blinkoff200,i-ci-ve:ver25-Cursor-blinkwait200-blinkon200-blinkoff200,r-cr-o:hor20",

Or something thereabouts. Just adding blinkwait and choosing a longer blink time.

I just learned how to use the NVIM_APPNAME environment variable to run Neovim with your config, and I'm sorry to say I could not reproduce. Are you running with the latest changes in Git? Are there possibly unpushed dotfiles changes that might be affecting things?

Jezda1337 commented 9 months ago

That doesn't work for me. I have no local changes for my nvim config. Everything is the same as with the repo I sent you. I have another issue as well, which could be related to the same issue here. I have to record using my phone because the Gnome default record app can't catch this. As you can see in the video, there are duplicate numbers while I'm scrolling. Any idea?

https://github.com/tim-harding/neophyte/assets/42359294/e301351e-64f1-44b9-8157-7a7d95268b53

tim-harding commented 9 months ago

Okay, that is some fascinating stuff. I can reproduce in my config as well. Will investigate.

Jezda1337 commented 9 months ago

Thanks; enjoy the process.

tim-harding commented 9 months ago

Seems to just be monitor ghosting. It also shows up in playback of a screen capture, but goes away if I pause the playback.

Jezda1337 commented 9 months ago

Can you reproduce this jumping while I'm moving up?

Screencast from 2024-01-17 01-21-26.webm

tim-harding commented 9 months ago

Yeah, that's just from smooth scroll. Looks kinda bad on the status column and breadcrumbs that share the same grid. You could look into whether the breadcrumbs can be rendered to a floating window or the winbar instead. I might investigate whether something similar could be done for the status column. Unfortunately, I can't do very much to mitigate this on the GUI side.

tim-harding commented 9 months ago

I switched the font loading library over to font-kit and added logging for when fonts could not be loaded. Seems to work a lot better. I think I'm going to close this issue now as most of the issues are addressed. Thank you for your reports and testing. Please open a new issue if you run into anything else.