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

feat(highlight): ✨ support multiple render types (background, virtual, etc.) [Max 2] #141

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

daUnknownCoder
Copy link

@daUnknownCoder daUnknownCoder commented Feb 7, 2025

Previously, the plugin only supported a single render type at a time. Now, users can specify multiple render types in setup, e.g., render = {"background", "virtual"}.

  • setup() now ensures render is always a table (You can pass a string too which will automatically be converted to a table)
  • highlight_colors() applies multiple render types
  • utils.create_highlight() adapts to handle single render types dynamically
  • Max 2 items so that it doesn't mess up (imagine background+foreground=only color no text)
  • validate_render_options(user_render) ensures there are no bad params passed
  • render accepts max 2 values or the nth value from 2 and above value is discarded
  • render has 2 values and if it contains background and foreground in one table, the second value is discarded

Use? I personally like Background+Virtual Text, so I made this with some help here and there from chatGPT

[My first PR, so I'm open to suggestions]

…, etc.) [Max 2]

Previously, the plugin only supported a single render type at a time.  
Now, users can specify multiple render types in `setup`, e.g.,  
`render = {"background", "virtual"}`.  

- `setup()` now ensures `render` is always a table  
- `highlight_colors()` applies multiple render types  
- `utils.create_highlight()` adapts to handle single render types dynamically  
- `Max 2 items` so that it doesn't mess up (imagine background+foreground=only color no text)
- `validate_render_options(user_render)` ensures there are no bad params passed
- `render` accepts max 2 values or the nth value from 2 and above value is discarded
- `render` has 2 values and if it contains `background` and `foreground` in one table, the second value is discarded

Use? I personally like Background+Virtual Text, so I made this with some help here and there from chatGPT
@daUnknownCoder
Copy link
Author

recording_2025-02-08_01.12.40.mp4

Added all the changes i made

updated docs for new changes in brenoprata10#141 (and minor refactoring)
@brenoprata10
Copy link
Owner

Hello o/
Could you please remove all of the additional tab formatting that was added with your PR? seems like some lines are just adding additional space :)

@daUnknownCoder
Copy link
Author

daUnknownCoder commented Feb 11, 2025

Could you please remove all of the additional tab formatting that was added with your PR? seems like some lines are just adding additional space :)

i updated some lines, i had to copy paste from my neovim into github in its editor because i mostly use 2 tab spaces and your code has 8 tabs so i had to copy paste here

also merged main into patch-1 with new buffer exclusion changes

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

Successfully merging this pull request may close these issues.

2 participants