Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ use({ "MaximilianLloyd/tw-values.nvim" })
},
opts = {
border = "rounded", -- Valid window border style,
title = "Tailwind CSS Values", -- Float window title
show_unknown_classes = true, -- Shows the unknown classes popup
focus_preview = true, -- Sets the preview as the current window
copy_register = "", -- The register to copy values to,
Expand All @@ -65,12 +66,13 @@ use({ "MaximilianLloyd/tw-values.nvim" })

## Configuration

Right now the configurtion options are quite minimal.
Right now the configuration options are quite minimal.

```lua
...
{
border = "rounded", -- Valid window border style,
title = "Tailwind CSS Values", -- Float window title
show_unknown_classes = true, -- Shows the unknown classes popup
focus_preview = false, -- Sets the preview as the current window
copy_register = "", -- The register to copy values to,
Expand Down
5 changes: 3 additions & 2 deletions lua/tw-values/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ local M = {}
function M.defaults()
local defaults = {
border = "rounded",
title = "Tailwind CSS values",
show_unknown_classes = true,
focus_preview = false,
copy_register = "",
Expand Down Expand Up @@ -247,7 +248,7 @@ function OpenFloats(results, unknownclasses)
end

local formatted_results = Utils.format_to_css(results)
local title = "Tailwind CSS values"
local title = M.options.title
local longest = Utils.get_longest(formatted_results, #title)
local height = #formatted_results

Expand All @@ -256,7 +257,7 @@ function OpenFloats(results, unknownclasses)
border = M.options.border,
width = longest,
height = height,
title = "Tailwind CSS values",
title = title,
})
-- Focus buf
-- Open a window below it
Expand Down