Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: invalid example, vim docs are outdated? #341

Closed
tmillr opened this issue Jul 8, 2024 · 1 comment
Closed

docs: invalid example, vim docs are outdated? #341

tmillr opened this issue Jul 8, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@tmillr
Copy link
Member

tmillr commented Jul 8, 2024

See #340

There is an example in the vim docs which doesn't work, and has multiple issues. It doesn't appear in the README, but it is found in Usage.md as well. It should probably just be removed since the same behavior can be achieved in/via setup()?

Overrides

The individual components, such as [palettes][palette], [specs][spec], and [groups][group], can be overridden separately to customize the theme according to your preferences.

local override = require('github-theme').override
override.palettes({
  github_dark = {
    red = '#ff0000',
  },
  github_light = {
    comment = '#636e7b',
  },
})
override.specs({
  github_dark = {
    syntax = {
      keyword = 'magenta'
    }
  }
})
override.groups({
  all = {
    IncSearch = { bg = 'palette.cyan' },
  },
})

Issues with the example:

  1. .overrides at the top should be apart of the require string/path
  2. overrides.{specs,palettes,groups} lower in the example are not functions (and shouldn't be called)
  3. Doing overrides this way may be sensitive to whether it's done before or after calling setup() and/or loading the theme (with :colorscheme ...)
@tmillr tmillr added the documentation Improvements or additions to documentation label Jul 11, 2024
tmillr added a commit to tmillr/github-nvim-theme that referenced this issue Jul 16, 2024
tmillr added a commit to tmillr/github-nvim-theme that referenced this issue Jul 16, 2024
tmillr added a commit to tmillr/github-nvim-theme that referenced this issue Jul 16, 2024
tmillr added a commit to tmillr/github-nvim-theme that referenced this issue Jul 16, 2024
tmillr added a commit to tmillr/github-nvim-theme that referenced this issue Jul 16, 2024
- Hash entire config instead of just the table passed to `setup()`. This
  helps to ensure that a re-compile occurs when overrides are set
  outside of `setup()`.

- Loading/sourcing colorscheme now causes re-compilation if config or
  overrides have changed, even if `setup()` has been called before.

- Clear `vim.g.colors_name` before setting `vim.o.background` so that
  colorscheme is not reloaded recursively when setting
  `vim.o.background` (as opposed to using a variable to check for nested
  colorscheme load, which is what we were doing before).

- fix(compiler): always write hash to filesystem whenever a compilation
  occurs, incl when `require('github-theme').compile()` is called
  directly.

Related: projekt0n#262, projekt0n#340, projekt0n#341

Please enter the commit message for your changes. Lines starting
th '%' will be ignored, and an empty message aborts the commit.
tmillr added a commit to tmillr/github-nvim-theme that referenced this issue Jul 16, 2024
- Hash entire config instead of just the table passed to `setup()`. This
  helps to ensure that a recompilation occurs when overrides are set
  outside of `setup()`.

- Loading/sourcing colorscheme now causes recompilation if config or
  overrides have changed, even if `setup()` has been called before.

- Clear `vim.g.colors_name` before setting `vim.o.background` so that
  colorscheme is not reloaded recursively when setting
  `vim.o.background` (as opposed to using a variable to check for nested
  colorscheme load, which is what we were doing before).

- fix(compiler): always write hash to filesystem when a compilation
  occurs, incl. when `require('github-theme').compile()` is called
  directly.

Related: projekt0n#262, projekt0n#340, projekt0n#341

Please enter the commit message for your changes. Lines starting
th '%' will be ignored, and an empty message aborts the commit.
tmillr added a commit that referenced this issue Jul 16, 2024
- Hash entire config instead of just the table passed to `setup()`. This
  helps to ensure that a recompilation occurs when overrides are set
  outside of `setup()`.

- Loading/sourcing colorscheme now causes recompilation if config or
  overrides have changed, even if `setup()` has been called before.

- Clear `vim.g.colors_name` before setting `vim.o.background` so that
  colorscheme is not reloaded recursively when setting
  `vim.o.background` (as opposed to using a variable to check for nested
  colorscheme load, which is what we were doing before).

- fix(compiler): always write hash to filesystem when a compilation
  occurs, incl. when `require('github-theme').compile()` is called
  directly.

Related: #262, #340, #341
tmillr added a commit that referenced this issue Jul 16, 2024
@tmillr
Copy link
Member Author

tmillr commented Jul 16, 2024

Fixed in a24960a

@tmillr tmillr closed this as completed Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant