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

Highlights of double-matched strings are reset on lines that contain an ansi color escape sequence #3596

Closed
5 of 10 tasks
ibhagwan opened this issue Jan 22, 2024 · 2 comments
Closed
5 of 10 tasks
Assignees
Labels

Comments

@ibhagwan
Copy link

  • I have read through the manual page (man fzf)
  • I have the latest version of fzf
  • I have searched through the existing issues

Info

  • OS
    • Linux
    • Mac OS X
    • Windows
    • Etc.
  • Shell
    • bash
    • zsh
    • fish

Problem / Steps to reproduce

Originally repoted at ibhagwan/fzf-lua#1012

When entering two query strings, the second match will clear the matches on lines that contain an ansi escape string.

This is best demonstrated with an example, run the below in the shell:

echo "\x1b[0;34mblue\x1b[0mnotblue\n\x1b[0;34mblue\x1b[0mnotblue\n\x1b[0;34mblue\x1b[0mnotblue\nbluenotblue" | fzf --ansi

Type not in the query and it gets matched correctly:
image

Now double the match by typing an addittional n, the n matches get reset in the lines that contain an anso color code:
image

Finally type not not and the entire match is reset on all lines that contain the ansi color code:
image

Note that the 3rd match works as expected:
image

@junegunn
Copy link
Owner

Thanks for the report, fixed it on master!

@ibhagwan
Copy link
Author

Thanks for the report, fixed it on master!

Ty @junegunn!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants