Iron-E / nvim-highlite

A colorscheme generator that is "lite" on logic for the developer.
Other
240 stars 33 forks source link

Complete example under Advanced Usage not working #29

Closed ilaitinen closed 1 year ago

ilaitinen commented 1 year ago

I run into type errors on the last line of the Complete example when following the Advanced Usage documentation.

My LSP detected the errors as the following:

Diagnostics:
1. Cannot assign `string` to parameter `table?`.
   - `string` cannot match `table?`
   - Type `string` cannot match `nil`
   - Type `string` cannot match `table` [param-type-mismatch]
2. This function expects a maximum of 1 argument(s) but instead it is receiving 3. [redundant-parameter]
3. This function expects a maximum of 1 argument(s) but instead it is receiving 3. [redundant-parameter]

Ignoring these and running :colorscheme NAME resulted in the following error:

Error detected while processing /Users/REDACTED/.config/nvim/colors/REDACTED.lua:
E5113: Error while calling lua chunk: vim/shared.lua:0: Expected table, got string
stack traceback:
        [C]: in function 'assert'
        vim/shared.lua: in function 'tbl_isempty'
        ...cal/share/nvim/lazy/nvim-highlite/lua/highlite/table.lua:7: in function 'is_empty'
        ...ocal/share/nvim/lazy/nvim-highlite/lua/highlite/init.lua:125: in function 'setup'
        /Users/REDACTED/.config/nvim/colors/REDACTED.lua:57: in main chunk

When peeking at the referenced line of code, it seems the documentation does not match the code, because setup() indeed expects only a single table as an argument.

I'm using nvim-highlite v4.12.0 installed via lazy.nvim 10.8.1 on Nvim v0.9.2.

To reproduce:

Iron-E commented 1 year ago

Good catch! I will have to update the documentation. setup should be generate there:

See this snippet from my config for a working example.