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

Indent guide #7

Open
rhysd opened this issue Dec 21, 2021 · 0 comments
Open

Indent guide #7

rhysd opened this issue Dec 21, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@rhysd
Copy link
Owner

rhysd commented Dec 21, 2021

Consider to add indent guide to the result snippets. Since snippets usually include indents and sometimes the indent level is deep, it would be helpful to know the level.

    ┊   match self.regions.first().copied() {
    ┊   ┊   Some((s, e)) if o == s && o < e => RegionBoundary::Start,
    ┊   ┊   Some((_, e)) if o == e => {
    ┊   ┊   ┊   // When the next region is adjcent, skip changing highlight
    ┊   ┊   ┊   match self.regions.get(1) {
    ┊   ┊   ┊   ┊   Some((s, _)) if o == *s => RegionBoundary::NotFound,
    ┊   ┊   ┊   ┊   _ => RegionBoundary::End,
    ┊   ┊   ┊   }
    ┊   ┊   }
    ┊   ┊   _ => RegionBoundary::NotFound,
    ┊   }
  • Character: (U+250A)
  • Color: gutter
  • Option: --no-indent-guide (indent guide is enabled by default)

Note that this feature is automatically disabled by --ascii-lines.

Challenges:

  • How to calculate indent width?
    • Width would be calculated at making chunks from grep matches.
  • How to handle tab character?
  • How to propagate the calculated indent width to a printer?

I should to confirm that the guides are not so noisy in outputs before implementing this by crafting an example output.

@rhysd rhysd added the enhancement New feature or request label Dec 21, 2021
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

No branches or pull requests

1 participant