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

Backward Selection Duplication Widening Selection. #2854

Closed
n0s4 opened this issue Jun 21, 2022 · 1 comment · Fixed by #2945
Closed

Backward Selection Duplication Widening Selection. #2854

n0s4 opened this issue Jun 21, 2022 · 1 comment · Fixed by #2945
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug

Comments

@n0s4
Copy link
Contributor

n0s4 commented Jun 21, 2022

Summary

If you have backwards facing selection represented by []:

[lo]rem
ipsum
dolor

Then you duplicate downwards with C:

[lo]rem
[ips]um
[dolo]r

The selection gets 1 character wider at each duplication. This only happens with backwards selections.

Reproduction Steps

I tried this:

  1. Type some sample text
  2. Place my selection facing backwards on the first line.
  3. CCC

I expected this to happen:

The lines to be duplicated downwards with the same width

Instead, this happened:

The selections got wider each time I duplicated downwards.

Helix log

~/.cache/helix/helix.log

Probably irrelevant? I included the immediate logs after replicating this with -vvv just in case.

2022-06-21T23:06:09.934 helix_loader [DEBUG] Located configuration folders: []
2022-06-21T23:06:09.956 mio::poll [TRACE] registering event source with poller: token=Token(1), interests=READABLE | WRITABLE
2022-06-21T23:06:09.956 mio::poll [TRACE] registering event source with poller: token=Token(2), interests=READABLE | WRITABLE
2022-06-21T23:06:09.956 mio::poll [TRACE] registering event source with poller: token=Token(0), interests=READABLE
2022-06-21T23:06:09.956 mio::poll [TRACE] registering event source with poller: token=Token(1), interests=READABLE
2022-06-21T23:06:12.555 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 1,
            head: 0,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:06:12.747 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 2,
            head: 1,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:06:12.992 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 3,
            head: 2,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:06:13.104 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 4,
            head: 3,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:06:13.229 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 5,
            head: 4,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:06:14.171 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 5,
            head: 4,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:06:14.629 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 7,
            head: 6,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:06:14.721 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 8,
            head: 7,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:06:14.987 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 9,
            head: 8,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:06:15.105 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 10,
            head: 9,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:06:15.300 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 11,
            head: 10,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:06:15.698 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 13,
            head: 12,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:06:15.816 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 14,
            head: 13,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:06:15.993 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 15,
            head: 14,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:06:16.195 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 16,
            head: 15,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:06:16.327 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 17,
            head: 16,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:06:59.293 mio::poll [TRACE] deregistering event source from poller
2022-06-21T23:06:59.294 mio::poll [TRACE] deregistering event source from poller
2022-06-21T23:06:59.294 mio::poll [TRACE] deregistering event source from poller
2022-06-21T23:07:19.536 helix_loader [DEBUG] Located configuration folders: []
2022-06-21T23:07:19.557 mio::poll [TRACE] registering event source with poller: token=Token(1), interests=READABLE | WRITABLE
2022-06-21T23:07:19.557 mio::poll [TRACE] registering event source with poller: token=Token(2), interests=READABLE | WRITABLE
2022-06-21T23:07:19.557 mio::poll [TRACE] registering event source with poller: token=Token(0), interests=READABLE
2022-06-21T23:07:19.557 mio::poll [TRACE] registering event source with poller: token=Token(1), interests=READABLE
2022-06-21T23:07:20.692 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 1,
            head: 0,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:07:20.873 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 2,
            head: 1,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:07:20.974 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 3,
            head: 2,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:07:21.046 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 4,
            head: 3,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:07:21.300 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 5,
            head: 4,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:07:21.880 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 7,
            head: 6,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:07:22.061 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 8,
            head: 7,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:07:22.163 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 9,
            head: 8,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:07:22.228 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 10,
            head: 9,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:07:22.450 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 11,
            head: 10,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:07:22.867 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 13,
            head: 12,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:07:22.987 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 14,
            head: 13,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:07:23.174 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 15,
            head: 14,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:07:23.366 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 16,
            head: 15,
            horiz: None,
        },
    ],
    primary_index: 0,
}
2022-06-21T23:07:23.537 helix_core::auto_pairs [DEBUG] autopairs hook selection: Selection {
    ranges: [
        Range {
            anchor: 17,
            head: 16,
            horiz: None,
        },
    ],
    primary_index: 0,
}

Platform

Linux

Terminal Emulator

alacritty 0.10.1-rc1

Helix Version

22.05-70-g15807d5f

@n0s4 n0s4 added the C-bug Category: This is a bug label Jun 21, 2022
@the-mikedavis
Copy link
Member

Ah I've seen this but couldn't manage to reproduce it nicely. I think it was introduced in ab7885e (that caused the same behavior when the selection was forwards but the forwards problem was fixed in 236c6b7)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants