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

bug: better handling of folds #39

Closed
1 task done
folke opened this issue Jun 23, 2023 · 12 comments · Fixed by #112 or #144
Closed
1 task done

bug: better handling of folds #39

folke opened this issue Jun 23, 2023 · 12 comments · Fixed by #112 or #144
Labels
enhancement New feature or request

Comments

@folke
Copy link
Owner

folke commented Jun 23, 2023

Did you check the docs?

  • I have read all the flash.nvim docs

Is your feature request related to a problem? Please describe.

currently matches inside folds are labeled

Describe the solution you'd like

need to think this through :)

Describe alternatives you've considered

not really

Additional context

No response

@folke folke added the enhancement New feature or request label Jun 23, 2023
@folke folke closed this as completed in 8af3773 Jul 2, 2023
@tssm
Copy link

tssm commented Jul 3, 2023

Could this be an option? Jumping to folds is quite useful sometimes

@folke
Copy link
Owner Author

folke commented Jul 3, 2023

Whats the use-case? Using incremental mode?

@tssm
Copy link

tssm commented Jul 3, 2023

No, just navigation. Sometimes I wanna jump to a fold and open it because the code I must read/modify is folded

@folke
Copy link
Owner Author

folke commented Jul 3, 2023

It doesn't seem to be possible to set extmarks on the folded line.

With something like nvim-ufo, you will see the markers

@MariaSolOs
Copy link

With something like nvim-ufo, you will see the markers

@folke what do you mean? I'm using nvim-ufo and I still cannot use flash to jump to folded lines or have any other indicators that would allow me to do so.

@folke
Copy link
Owner Author

folke commented Jul 12, 2023

@MariaSolOs I mean you can jump to the summary shown on the fold for a word in that fold.

Still need to make it so that a folded line also gets a label (one) when the text inside the fold matches the pattern.

@folke
Copy link
Owner Author

folke commented Jul 12, 2023

Added proper support for folds.

The fold line will now show the label of the first match inside a fold. See example below:

image

When hitting the label, the cursor will open the fold and jump to the first result. Also works in visual and operator pending modes.

@MariaSolOs
Copy link

The fold line will now show the label of the first match inside a fold.

Why limit the label to the first match? Not asking you to change this BTW, I'm just curious :)

@folke
Copy link
Owner Author

folke commented Jul 12, 2023

Since you can't see the targets you are jumping to, I don't think it makes sense to show all the labels for items in the folds?

@MariaSolOs
Copy link

@folke What I had in mind is that say I'm jumping to the following line with se:

> fn folded_method () {

I thought something like this would happen (adding the labels to both occurrences of e):

> fn foldad_mxthod () {

@folke
Copy link
Owner Author

folke commented Jul 12, 2023

Oh you mean on the foldtext? That's not how it currently works. It's also not straightforward to map actual cursor positions to a position inside the foldtext.

The feature I did add is say you have a multiline fold and the pattern matches something in line 3 of your fold, then you'd still be able to jump to that

@MariaSolOs
Copy link

That makes sense, thanks for explaining!

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

Successfully merging a pull request may close this issue.

3 participants