1
0
Fork 0
mirror of https://github.com/jiriks74/presence.nvim synced 2025-04-05 12:03:00 +02:00

allow custom main image

This commit is contained in:
SIGMazer 2023-05-16 01:20:38 +03:00
parent 87c857a56b
commit 0dbcdebb2f

View file

@ -118,7 +118,6 @@ function Presence:setup(...)
self:set_option("auto_update", 1)
self:set_option("client_id", "793271441293967371")
self:set_option("debounce_timeout", 10)
self:set_option("main_image", "neovim")
self:set_option("neovim_image_text", "The One True Text Editor")
self:set_option("enable_line_number", false)
-- Status text options
@ -821,8 +820,9 @@ function Presence:update_for_buffer(buffer, should_debounce)
local file_text = description or name
local neovim_image_text = self.options.neovim_image_text
local use_file_as_main_image = self.options.main_image == "file"
local use_neovim_as_main_image = self.options.main_image == "neovim"
local assets = {
large_image = use_file_as_main_image and asset_key or "neovim",
large_image = use_file_as_main_image and asset_key or use_neovim_as_main_image and "neovim" or self.options.main_image,
large_text = use_file_as_main_image and file_text or neovim_image_text,
small_image = use_file_as_main_image and "neovim" or asset_key,
small_text = use_file_as_main_image and neovim_image_text or file_text,