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

Tui support for highlighting #2

Closed
JBenda opened this issue Jun 15, 2021 · 8 comments
Closed

Tui support for highlighting #2

JBenda opened this issue Jun 15, 2021 · 8 comments
Labels
enhancement New feature or request

Comments

@JBenda
Copy link

JBenda commented Jun 15, 2021

The Highlighting groups don't provide any cterm definitions for the TUI.
I found in lua/lightspeed.lua around line 175 the definition of the highlight groups

Is a target of this project to support TUI too?, then I could open a PR with my changes to discuss a possible implementation.

@ggandor
Copy link
Owner

ggandor commented Jun 15, 2021

Sure, we just need to add the corresponding cterm attributes to the group definitions. The question is, should we convert the values to 256 colors then? Or maybe 16?

The .lua file is generated, you can find the relevant part in the Fennel source file here.

@ggandor ggandor added the enhancement New feature or request label Jun 15, 2021
@JBenda
Copy link
Author

JBenda commented Jun 15, 2021

Thanks, I was already wondering how you possibly can keep track of all this _16_ ;)
NeoVIM only supports 16 colors for console because of compatibility.

@JBenda
Copy link
Author

JBenda commented Jun 15, 2021

In #4 is a simple idea how a solution looks like.
It's mirrored what I have changed in the lightspee.lua to make it work on my machine.

@ggandor
Copy link
Owner

ggandor commented Jun 15, 2021

Thank you :) Yeah, this is pretty much all we need to do. Will look at this tonight, test and tweak the colors, and figure out a good scheme for light background...

There is a makefile included that you could use to compile the Fennel file to the lua folder, just run make after finishing the edits, and then the plugin can be tested locally after re-sourcing.

@JBenda
Copy link
Author

JBenda commented Jun 15, 2021

Good to know, I never worked with Lua or Fennel before ^^

@clason
Copy link

clason commented Jun 16, 2021

Might I suggest just defining LightspeedFoo highlight groups and letting color schemes / user configs sort out the actual colors? You can link them to standard highlight groups (Search, IncSearch) by default. This should be more portable / extensible and is how, e.g., gitsigns does this.

(Also, TUIs do use guifg if termguicolors is set.)

@ggandor
Copy link
Owner

ggandor commented Jun 16, 2021

Might I suggest just defining LightspeedFoo highlight groups and letting color schemes / user configs sort out the actual colors?

Preaching to the choir: :h lightspeed-highlight.

(Also, TUIs do use guifg if termguicolors is set.)

Yeah, that's why I skipped defining cterm groups, but it would be better to provide defaults for those anyway.

@JBenda
Copy link
Author

JBenda commented Jun 16, 2021

(Also, TUIs do use guifg if termguicolors is set.)

but this settting breaks many plugins ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants