feat: load configuration at each command, so it is not needed to restart nvim on config change
This commit is contained in:
@@ -178,6 +178,8 @@ end
|
||||
-- :ChatGPT
|
||||
------------------------------------------------------------------------------
|
||||
local function run_chatgpt_command()
|
||||
package.loaded["chatgpt_nvim.config"] = nil
|
||||
local config = require("chatgpt_nvim.config")
|
||||
local conf = config.load()
|
||||
ui.setup_ui(conf)
|
||||
ui.debug_log("Running :ChatGPT command.")
|
||||
@@ -248,6 +250,8 @@ end
|
||||
-- :ChatGPTPaste
|
||||
------------------------------------------------------------------------------
|
||||
local function run_chatgpt_paste_command()
|
||||
package.loaded["chatgpt_nvim.config"] = nil
|
||||
local config = require("chatgpt_nvim.config")
|
||||
local conf = config.load()
|
||||
ui.setup_ui(conf)
|
||||
ui.debug_log("Running :ChatGPTPaste command.")
|
||||
@@ -398,6 +402,8 @@ end
|
||||
-- :ChatGPTCurrentBuffer
|
||||
------------------------------------------------------------------------------
|
||||
local function run_chatgpt_current_buffer_command()
|
||||
package.loaded["chatgpt_nvim.config"] = nil
|
||||
local config = require("chatgpt_nvim.config")
|
||||
local conf = config.load()
|
||||
ui.setup_ui(conf)
|
||||
ui.debug_log("Running :ChatGPTCurrentBuffer command.")
|
||||
|
||||
Reference in New Issue
Block a user