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

Better Dimming with Markdown Files? #16

Open
FOSSilizedDaemon opened this issue Aug 23, 2021 · 3 comments
Open

Better Dimming with Markdown Files? #16

FOSSilizedDaemon opened this issue Aug 23, 2021 · 3 comments

Comments

@FOSSilizedDaemon
Copy link

I am loving using Twilight, but I have noticed that in markdown files Twilight does not proper see the see the beginning or end of each block. For example here you can see it highlight two blocks instead of just one. Is there anything I can do to get it to only highlight one block?

@Hubro
Copy link

Hubro commented May 5, 2022

Have you tried tweaking the context config option?

@FOSSilizedDaemon
Copy link
Author

Have you tried tweaking the context config option?

The issue is sometimes I have more than X lines I need to highlight around the current line.

@TymekDev
Copy link

I have also experienced a bit awkward dimming in markdown. I have set context to 0 and you can see results below.

I found out that using tree-sitter playground setting I could provide sensible values to expand option in Twilight config. These three values fix make entire paragraph, code block, and list highlighted.

require("twilight").setup({
  context = 0,
  expand = {
    -- markdown
    "paragraph",
    "fenced_code_block",
    "list",
  }
})

I am a bit concerned about possible naming collision in tree-sitter nodes, but I have no clue if it is a valid concern. If it is, then perhaps expand could be extended to provide values per filetype?

Default config with context = 0

Section and paragraph

Code block

List

TymekDev added a commit to TymekDev/dotfiles that referenced this issue Aug 29, 2022
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

No branches or pull requests

3 participants