-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Highlighting Folded #12649
Comments
I've been working towards this in #12515. |
@teto nice! What would you say is the current progress on this (percent wise)? Do you need any help? |
the tests fail because win_line has 2 distinct paths to display characters Line 3266 in a02a267
I need the foldtext to follow the (more comprehensive) second path rather than the first one but that's quite tricky. I was hoping to take the opportunity to make the win_line function simpler but that's no easy task. |
If you fix this problem then all of the tests pass? I saw that you currently have no time to work on this, is this still the case? I could help you, but I have never worked with the neovim source code before so I might take some time to get to know the codebase.
Is it required to simplify the function?
Why does it need to follow the second path and what exactly do you mean by more comprehensive? Are there only edge cases left or is the functionality missing something? |
let's say it's rather complex. If you dont use Hebrew or Arabic characters ,you could aready use the patch. |
Would your pr also include conceal support in closed folds? example:source# header conceal conceal- header define a foldtext function that just returns the same line and set the fillchar for fold to fold + conceal (without pr)# header fold + conceal (hopefully with pr)- header Thanks for your work! Looks like you don't need my help, so I can only wish you good luck with your bug hunt :) |
Looks like this is the same as #2197 |
sorry I misunderstood your request. |
I'm not sure if I'm doing anything wrong, but even after #12515 was merged I still get no syntax highlighting on folded lines, following the specific example in the first post from @TimUntersberger. Should I? Is there anything specific I should enable/disable to ensure that my folded lines are highlited as if they weren't folded? |
its normal. I dont think it is possible yet (maybe with lua themas ?). What would be your scenario ? |
Will it ever be possible to have normal syntax highlighting of folded function or block? This seems so natural and straightforward but for whatever reason Vim paints all set foldmethod=expr
set foldexpr=nvim_treesitter#foldexpr()
set foldtext=MyFoldTextSimple()
function! MyFoldTextSimple()
return getline(v:foldstart)
endfunction |
I really need this for Neogit too. |
One more use case for it comes from orgmode.nvim. Here's comparison of the same file in Emacs and NeoVim. You can see than in NeoVim (2nd screenshot) the color is defined by folding. If it's folded - you cannot highlight it depending on whether it's DONE or TODO. In Emacs however, folding is an invisible detail (as it should be) and doesn't affect the highlighting. Also really looking forward to this feature as #12515 doesn't seem to be addressing this. I'm also wondering, what this feature would look like UX-wise. It might be:
|
The main idea should be that syntax definitions should apply the same way to the content of the fold like as they would to other non folded lines, so color authors can choose to differentiate based on fold state if they want (DONE in dim folding... example) or regular (TODO with folding... example). |
Couldn't Folded hl be applied just as Diff highlights? Ie without changing foreground hl unless explicitly defined |
This is a solid alternative until we get built-in support: https://github.com/kevinhwang91/nvim-ufo |
nvim --version
:vim -u DEFAULTS
(version: ) behaves differently? no$TERM
: xterm-256colorIs there a way to highlight Folded text?
I'm currently writing a plugin in lua that adds highlighting the following way:
I modify the fold settings in the following way:
This is how it looks with an open fold
This is how it looks with a closed fold
Is there a way to make the second image look like the first and if there is none is there a plan to make this happen (or is it easy to implement then I might do it myself)?
The text was updated successfully, but these errors were encountered: