clipster icon indicating copy to clipboard operation
clipster copied to clipboard

sync_selections + pattern_as_selection = infinite loop

Open rayx opened this issue 6 years ago • 1 comments

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 avatar Oct 17 '19 03:10 rayx

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[bot] avatar Apr 16 '22 14:04 stale[bot]