giusgad / pets.nvim

Display pets in your editor 🐱

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When transparent; pets disappear upon resizing or moving the window, or changing font size.

KorayAydemir opened this issue · comments

Description

Moving, resizing, changing font size with kitty shortcuts... Anything that manipulates the window i guess makes the pets disappear. CTRL + L makes them disappear as well.

This doesn't happen if my background is not transparent.

same behaviour with winblend=0, avoid_statusline=false options.

Steps to reproduce

  1. Open nvim
  2. Run :PetsNew a with this config
  3. Try resizing the window. Pets won't disappear
  4. Add vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) in config for transparency.
  5. Exit and open nvim.
  6. Try resizing the window.
  7. Pets disappear upon resizing now. They shouldn't.

Your options

vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })

require("pets").setup({

	popup = { -- popup options, try changing these if you see a rectangle around the pets
		width = "50%", -- can be a string with percentage like "45%" or a number of columns like 45
		winblend = 100, -- winblend value - see :h 'winblend' - only used if avoid_statusline is false
		hl = { Normal = "Normal" }, -- hl is only set if avoid_statusline is true, you can put any hl group instead of "Normal"
		avoid_statusline = true, -- if winblend is 100 then the popup is invisible and covers the statusline, if that
		-- doesn't work for you then set this to true and the popup will use hl and will be spawned above the statusline (hopefully)
	},
	row = 6, -- the row (height) to display the pet at (higher row means the pet is lower on the screen), must be 1<=row<=10
	col = 0, -- the column to display the pet at (set to high number to have it stay still on the right side)
	speed_multiplier = 1, -- you can make your pet move faster/slower. If slower the animation will have lower fps.
	random = true, -- wether to use a random pet for the PetNew command, ovverides default_pet and default_style
	default_pet = "dog", -- the pet to use for the PetNew command
	default_style = "brown", -- the style of the pet to use for the PetNew command
	death_animation = true, -- animate the pet's death, set to false to feel less guilt -- currently no animations are available
})

Screenshots

2023-05-24.12-49-43.mp4

Extra

No response

@KorayAydemir In my case your issue happened only if I sourced the config without closing and reopening neovim, please let me know if the new commit has fixed it (it has for me). If the problem persists, it probably has to do with some other difference in our configs

It did not fix, same behaviour persists. If I have
vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
line on top of my config, which gives me transparency, then this bug happens.

I have deleted ~/.local/share/nvim then deleted ~/.config/nvim
started with a fresh neovim
pasted the same config as the one in this issue inside init.lua.
same problem.
pasted the default config.
same problem
pasted this and tried :PetsNew a again:
:highlight Normal ctermfg=grey ctermbg=darkblue
it works as long as this is set. So can't use it with transparency. For example if I do this right after:
:highlight Normal ctermfg=grey ctermbg=darkblue
Now its disappearing on window resizes again.

Tried with empty kitty config too just in case, didn't change anything.

If this is system spesific and not config spesific, i guess it would be pretty hard to debug so, whatever.

Thank you for your effort to try to find the source of the problem, I was finally able to reproduce the issue with minimal config but still have no idea why transparency is influencing the pets. Right now I'm pretty busy with university so I won't be able to look to much into this sorry.