Skip to content

Bug: Neovim Freezes a bit after taking snapshot on Fedora 43 Gnome #166

@RantoPhantom

Description

@RantoPhantom

Build

latest stable 2.0.0
Using Lazy.nvim:
{ "mistricky/codesnap.nvim" },

System

Lenovo T495s 3700u
Fedora 43 Gnome
Neovim 0.11.5

Config

local codesnap = require("codesnap")
codesnap.setup({
	show_line_number = true,
	highlight_color = "#ffffff20",
	show_workspace = false,
	snapshot_config = {
		theme = "candy",
		window = {
			mac_window_bar = false,
			shadow = {
				radius = 20,
				color = "#00000040",
			},
			margin = {
				x = 0,
				y = 0,
			},
			border = {
				width = 1,
				color = "#ffffff30",
			},
			title_config = {
				color = "#ffffff",
				font_family = "Pacifico",
			},
		},
		themes_folders = {},
		fonts_folders = {},
		line_number_color = "#495162",
		command_output_config = {
			prompt = "",
			font_family = "CaskaydiaCove Nerd Font",
			prompt_color = "#F78FB3",
			command_color = "#98C379",
			string_arg_color = "#ff0000",
		},
		code_config = {
			font_family = "CaskaydiaCove Nerd Font",
			breadcrumbs = {
				enable = true,
				separator = "/",
				color = "#80848b",
				font_family = "CaskaydiaCove Nerd Font",
			},
		},
		watermark = {
			content = "CodeSnap.nvim",
			font_family = "Pacifico",
			color = "#ffffff",
		},
		background = {
			start = {
				x = 0,
				y = 0,
			},
			["end"] = {
				x = "max",
				y = 0,
			},
			stops = {
				{
					position = 0,
					color = "#6bcba5",
				},
				{
					position = 1,
					color = "#caf4c2",
				},
			},
		},
	},
})

Problem Description

When using any command to take code snaps, neovim freezes for around 20s -> 30s.
The screenshot was taken successfully and copied into clipboard, no cpu usage from neovim or anywhere else that is suspicious neovim is just freezing.

When using a clipboard manager like Gnome Clipboard Indicator, when the snapshot gets copied, open and recopy/select the screenshot to resume neovim like ex-jandal says.

When not using clipboard manager, it will freeze indefinitely.

Notes

In v1, Codesnap only took 1s max to take snapshot

When upgrading from v1, a bug with parse_code_theme is nil occured so I cleaned and did a new install which leads to the current problem.

Workaround

Gnome: Use a clipboard manager to re select the image in the clipboard to resume neovim.
Others(?): use wl-clip-persist like larkjkj says

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions