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

sync_selections + pattern_as_selection = infinite loop #86

Open
rayx opened this issue Oct 17, 2019 · 1 comment · May be fixed by #87
Open

sync_selections + pattern_as_selection = infinite loop #86

rayx opened this issue Oct 17, 2019 · 1 comment · May be fixed by #87

Comments

@rayx
Copy link

rayx commented Oct 17, 2019

There are two main mechanisms in the code to prevent indefinite looping:

  • The check in line 456 prevents indefinite loop that primary selection and clipboard keep synchronizing with each other.

  • The check in line 433 prevents indefinite loop that a selection (either primary or clipboard) keeps updating itself. The ignore_next flag also helps, but it's not required.

The issue is that the first check doesn't work when both sync_selections and pattern_as_selection are true. The check should be against matched text, instead of original text, in this case.

I hit the issue with the following config (irrelevant options are skipped):

active_selections = PRIMARY,CLIPBOARD
sync_selections = yes
extract_patterns = yes
pattern_as_selection = yes

Then define a pattern to extract part of the selected text should be able reproduce the issue.

@rayx rayx changed the title sync_selections + pattern_as_selection = indefinite loop sync_selections + pattern_as_selection = infinite loop Oct 17, 2019
@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 16, 2022
@stale stale bot closed this as completed Apr 28, 2022
@mrichar1 mrichar1 reopened this Apr 28, 2022
@stale stale bot removed the stale label Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants