Skip to content

sync_selections + pattern_as_selection = infinite loop #86

@rayx

Description

@rayx

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions