Skip to content

fix: guard auto-setup to not overwrite user config - #7

Merged
techwizrd merged 1 commit into
techwizrd:mainfrom
AchmadFathoni:main
Jun 13, 2026
Merged

techwizrd merged 1 commit into
techwizrd:mainfrom
AchmadFathoni:main

Conversation

@AchmadFathoni

Copy link
Copy Markdown
Contributor

The plugin/render_latex.lua unconditionally calls require("render_latex").setup() when loaded, which resets any user-provided options back to defaults after the user's own setup() call.

This change only runs the auto-setup if the user has not already called setup() themselves.

The guard ensures backward compatibility.

I use vim-plug like

local Plug = vim.fn["plug#"]
vim.call("plug#begin", vim.fn.expand("~/.config/nvim/plugged"))
Plug "techwizrd/render-latex.nvim"
vim.call("plug#end")  -- sources plugin/render_latex.lua → old code calls setup() with defaults

require("render_latex").setup({ install = { auto = false } })

:lua =require("render_latex.config").install.auto return true

@techwizrd
techwizrd merged commit ad8a434 into techwizrd:main Jun 13, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants