Skip to content

shrink_selection breaks when expand_selection is used on a different document in the same view #6087

Open
@gibbz00

Description

@gibbz00

Summary

Introduced in #1340

Not linking the selection change to a document leads to broken behavior.

Say expand_selection is used on the current document, and then again on another document in the same view,
If shrink_selection is used on the original document, then the wrong selection will be popped from
view.object_selections. The resulting behavior is usually that shrink_selection stops working on the original document.

Also, not linking it to the document will in no way free the selection memory when the document is closed, which I presume is a memory leak. Guess desired behavior if document is reopened anyways.

Reproduction Steps

asciicast

Jittering and weird color/characters is only on the asciinema. Not visible on my screen during recording nor normal use of helix.

Helix log

No response

Platform

Linux

Terminal Emulator

foot

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions