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

colored indent guides #4010

Open
txtyash opened this issue Sep 28, 2022 · 8 comments
Open

colored indent guides #4010

txtyash opened this issue Sep 28, 2022 · 8 comments
Labels
A-helix-term Area: Helix term improvements A-theme Area: Theme and appearence related C-enhancement Category: Improvements

Comments

@txtyash
Copy link
Contributor

txtyash commented Sep 28, 2022

Indent guides should look smoother and highlighted depending on the currently focused paragraph.

@txtyash txtyash added the C-enhancement Category: Improvements label Sep 28, 2022
@dead10ck dead10ck added A-helix-term Area: Helix term improvements A-theme Area: Theme and appearence related labels Sep 28, 2022
@txtyash txtyash changed the title Smooth & colored indent-guide Colored indent-guide Sep 29, 2022
@txtyash
Copy link
Contributor Author

txtyash commented Sep 29, 2022

The default indent-guides look good enough. Can they be replaced with a little thicker line?

character = "▏"

This isn't too thick. It looks decent.

Other than that, just highlighting the indent-guide depending on the scope.

@the-mikedavis
Copy link
Member

I prefer the default character; I think it looks better to be centered rather than left-aligned.

What were you thinking for highlighting? I remember a chat in the Matrix room about using rainbow colors like in #2857

@SoraTenshi
Copy link
Contributor

What were you thinking for highlighting? I remember a chat in the Matrix room about using rainbow colors like in #2857

I believe something like i have in my neovim config:
image

@SoraTenshi
Copy link
Contributor

Well since i actually also wanted that feature, i figured to quickly implement this.

@musjj
Copy link

musjj commented Oct 9, 2023

Rainbow guides are great, but based on OP's wording I don't think that's what they were asking. I think OP is asking for an option to highlight the indent guide of the paragraph that the cursor is currently on.

An example screenshot:

@txtyash
Copy link
Contributor Author

txtyash commented Oct 9, 2023

An example screenshot:

Yes, this is what I meant. Personally I think that rainbow indents look cool but these are simple, subtle and more practical.

@txtyash txtyash changed the title Colored indent-guide indent-guide Oct 10, 2023
@txtyash txtyash changed the title indent-guide Add indent guides Oct 10, 2023
@pascalkuthe pascalkuthe changed the title Add indent guides colored indent guides Oct 26, 2023
omentic added a commit to omentic/helix-ext that referenced this issue Nov 1, 2023
ref: helix-editor/helix#4010
ref: helix-editor/helix#4493

Co-authored-by: SoraTenshi <dream@neoncity.dev>
@carlosvigil
Copy link

carlosvigil commented Nov 19, 2023

I see 5 options:
0. off

  1. on (the current guides)
  2. active/current highlight
  3. rainbow
  4. rainbow with current highlight

Active highlight seems the most practical as long as the dimmed characters are of sufficient contrast, so don't see the need for non-differentiated guides. It could be 3 options.

@palango
Copy link
Contributor

palango commented Feb 21, 2024

I think those steps are required to highlight the current scope using the indent guides.

  1. For each selection of a document, get the parent node via treesitter. Should be similar to
    pub fn expand_selection(syntax: &Syntax, text: RopeSlice, selection: Selection) -> Selection {
  2. Pass the range information of the parent node to render_text.
  3. Map the selection ranges to lines in the rendering code.
  4. Pass those infos to draw_indent_guides and choose a different style there if inside the range and at the parents indention level.

I'd be happy to give this a try, but steps 2-4 are a bit unclear to me. Any hints are appreciated.

omentic pushed a commit to omentic/helix-ext that referenced this issue May 1, 2024
omentic pushed a commit to omentic/helix-ext that referenced this issue May 1, 2024
omentic pushed a commit to omentic/helix-ext that referenced this issue May 1, 2024
omentic pushed a commit to omentic/helix-ext that referenced this issue May 1, 2024
omentic pushed a commit to omentic/helix-ext that referenced this issue May 1, 2024
omentic pushed a commit to omentic/helix-ext that referenced this issue May 1, 2024
omentic pushed a commit to omentic/helix-ext that referenced this issue May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements A-theme Area: Theme and appearence related C-enhancement Category: Improvements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants