Adds minimal repro script (#98)

* chore: creates minimal.lua to reproduce issues

* doc: adds testing section to readme
This commit is contained in:
Meow Honk 2024-11-18 20:11:31 -06:00 committed by GitHub
parent f6bba01ddd
commit e0b789cc8d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 53 additions and 0 deletions

View file

@ -9,8 +9,10 @@
- [Why another highlighter?](#why-another-highlighter)
- [Customization](#customization)
- [Updating color even when buffer is not focused](#updating-color-even-when-buffer-is-not-focused)
- [Testing](#testing)
- [Extras](#extras)
- [TODO](#todo)
- [Similar projects](#similar-projects)
<!--toc:end-->
[![luadoc](https://img.shields.io/badge/luadoc-0.1-blue)](https://nvchad.com/nvim-colorizer.lua/)
@ -268,6 +270,18 @@ For lower level interface, see
[LuaDocs for API details](https://nvchad.com/nvim-colorizer.lua/modules/colorizer.html)
or use `:h colorizer` once installed.
## Testing
To test colorization with your config, edit `test/expect.txt` to see expected
highlights
For troubleshooting use `test/minimal.lua`. Edit the file to configure colorizer.
Run `minimal.lua` to startup neovim:
```bash
nvim --clean -u minimal.lua expect.txt
```
## Extras
Documentaion is generated using ldoc. See

1
test/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
colorizer_issue/

38
test/minimal.lua Normal file
View file

@ -0,0 +1,38 @@
-- Run this file as `nvim --clean -u minimal.lua expect.txt`
for name, url in pairs({
colorizer = "https://github.com/NvChad/nvim-colorizer.lua",
}) do
local install_path = vim.fn.fnamemodify("colorizer_issue/" .. name, ":p")
if vim.fn.isdirectory(install_path) == 0 then
vim.fn.system({ "git", "clone", "--depth=1", url, install_path })
end
vim.opt.runtimepath:append(install_path)
end
-- Configure setup opts
local opts = {
user_default_options = {
RGB = true,
RRGGBB = true,
names = true,
RRGGBBAA = true,
AARRGGBB = true,
rgb_fn = true,
hsl_fn = true,
css = true,
css_fn = true,
mode = "background",
tailwind = "lsp",
sass = {
enable = false,
parsers = { "css" },
},
virtualtext = "",
},
buftypes = { "!prompt", "!popup" },
user_commands = true,
}
require("colorizer").setup(opts)
-- ADD INIT.LUA SETTINGS _NECESSARY_ FOR REPRODUCING THE ISSUE