From d06dc900f312941c721918419c638df10f6a1df0 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Fri, 17 May 2024 23:03:35 -0500 Subject: [PATCH] refactor: private `did_setup` opt in Setup --- lua/nvim-ts-autotag/config/plugin.lua | 3 ++- lua/nvim-ts-autotag/internal.lua | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/nvim-ts-autotag/config/plugin.lua b/lua/nvim-ts-autotag/config/plugin.lua index 1e53045..ff4e7c4 100644 --- a/lua/nvim-ts-autotag/config/plugin.lua +++ b/lua/nvim-ts-autotag/config/plugin.lua @@ -112,7 +112,8 @@ local Opts = { } ---@class nvim-ts-autotag.PluginSetup ----@field opts nvim-ts-autotag.Opts? +---@field private did_setup boolean +---@field opts nvim-ts-autotag.Opts? General setup optionss ---@field aliases { [string]: string }? Aliases a filetype to an existing filetype tag config ---@field per_filetype { [string]: nvim-ts-autotag.Opts }? Per filetype config overrides local Setup = { diff --git a/lua/nvim-ts-autotag/internal.lua b/lua/nvim-ts-autotag/internal.lua index fa1eb98..f6b50ff 100644 --- a/lua/nvim-ts-autotag/internal.lua +++ b/lua/nvim-ts-autotag/internal.lua @@ -442,6 +442,7 @@ end M.attach = function(bufnr) bufnr = bufnr or vim.api.nvim_get_current_buf() + ---@diagnostic disable-next-line: invisible if not Setup.did_setup then local _, ts_configs = pcall(require, "nvim-treesitter.configs") if not ts_configs then