Skip to content

Commit

Permalink
feat: added float to see merged settings
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Sep 10, 2022
1 parent f683564 commit 1097809
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lua/settings/commands.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
local Util = require("settings.util")
local Config = require("settings.config")
local Settings = require("settings.settings")

local M = {}
Expand All @@ -9,6 +8,9 @@ function M.setup()
lsp = function()
require("settings.view").show_lsp_settings()
end,
show = function()
require("settings.view").show_settings()
end,
["local"] = function()
M.edit({ ["local"] = true })
end,
Expand Down
7 changes: 5 additions & 2 deletions lua/settings/view.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,17 @@ function M.show_settings()

for _, item in ipairs(require("settings.commands").get_files()) do
if Util.exists(item.file) then
local line = "## " .. vim.fn.fnamemodify(item.file, ":~")
local line = "* " .. vim.fn.fnamemodify(item.file, ":~")
if item.is_global then
line = line .. ""
end
table.insert(content, line)
table.insert(content, "```lua\n" .. vim.inspect(require("settings.settings").get(item.file):get()) .. "\n```\n")
end
end

local settings = require("settings").get()

table.insert(content, "```lua\n" .. vim.inspect(settings) .. "\n```\n")
M.show(table.concat(content, "\n"))
end

Expand Down

0 comments on commit 1097809

Please sign in to comment.