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

don't duplicate text after prefix when --color is used along --prefix #975

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shadowwa
Copy link
Contributor

when using --prefix along --color as done in https://github.com/coreyja/fzf.devicon.vim the text comming after the prefix is duplicated

it can be reproduced by

$ rg --column --line-number --no-heading --color=always --smart-case -- Extends vendor/smarty/ | devicon-lookup --color --prefix :
 vendor/smarty/smarty/demo/plugins/resource.extendsall.php:4:4: * Extends All Resource:4:4: * Extends All Resource
 vendor/smarty/smarty/demo/plugins/resource.extendsall.php:11:23:class Smarty_Resource_Extendsall extends Smarty_Internal_Resource_Extends:11:23:class Smarty_Resource_Extendsall extends Smarty_Internal_Resource_Extends

while the expected result should be

 vendor/smarty/smarty/demo/plugins/resource.extendsall.php:4:4: * Extends All Resource
 vendor/smarty/smarty/demo/plugins/resource.extendsall.php:11:23:class Smarty_Resource_Extendsall extends Smarty_Internal_Resource_Extends

I've added a test and a simple test to fix the problem.

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

Successfully merging this pull request may close these issues.

1 participant