Skip to content

Commit af4714a

Browse files
authored
Merge pull request #6 from lnc3l0t/fix-global-variables
Global variables for configuring plugin didn't work
2 parents 6a4da61 + b4957f5 commit af4714a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lua/gist/core/gh.lua

+5-5
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ end
4444
--
4545
-- @return table A table with the configuration properties
4646
function M.read_config()
47-
local ok, values = pcall(vim.api.nvim_get_var, { "gist_is_private", "gist_clipboard" })
48-
49-
local is_private = ok and values[1] or false
50-
local clipboard = ok and values[2] or "+"
47+
local ok_private, private = pcall(vim.api.nvim_get_var, "gist_is_private")
48+
local is_private = ok_private and private or false
49+
local ok_clipboard, clipboard = pcall(vim.api.nvim_get_var, "gist_clipboard")
50+
local clipboard_reg = ok_clipboard and clipboard or "+"
5151

5252
local config = {
5353
is_private = is_private,
54-
clipboard = clipboard,
54+
clipboard = clipboard_reg,
5555
}
5656

5757
return config

0 commit comments

Comments
 (0)