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

FR: highlight 'content' #32

Open
guoang opened this issue Feb 2, 2023 · 5 comments
Open

FR: highlight 'content' #32

guoang opened this issue Feb 2, 2023 · 5 comments

Comments

@guoang
Copy link

guoang commented Feb 2, 2023

Great Plugin!

Is there a way to highlight the 'content'?
It'll make the function signature looks better

image

image

@anurag3301
Copy link

anurag3301 commented Aug 15, 2023

Same, would it be possible to have some simple colours in fold signature, it looks pretty dull right now

image

@anurag3301
Copy link

Seems like work the discussion has been going on for quite a while on neovim

Here are few threads

  1. Issue #12649
  2. PR #23471
  3. PR #20750

@stevanmilic
Copy link

This could be implemented now, since neovim/neovim#25209 has been merged.

@alexveden
Copy link

I managed to do this in C, however it's nothing to do with pretty-fold plugin. If you do, tree sitter folding plugin this is an option: nvim-treesitter/nvim-treesitter#1564

You need to add the following into config file:

      vim.treesitter.query.set(
        "c",
        "folds",
        [[
          [
           (switch_statement)
           (case_statement)
           (comment)
          ] @fold
          (function_definition
            type: (type_identifier)  @fold
          )
          (function_definition
            body: (compound_statement)  @fold
          )
          ]]
      )

      vim.treesitter.query.set(
        "cpp",
        "folds",
        [[
          [
           (switch_statement)
           (case_statement)
           (comment)
           (function_definition)
          ] @fold
          ]]
      )

The above code folds this code:
image

Into:
image

@Duologic
Copy link

An alternative approach was choosen upstream to support this: neovim/neovim#20750

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

5 participants