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

Select object not work when cursor at the close pair #1077

Closed
QiBaobin opened this issue Nov 11, 2021 · 1 comment · Fixed by #1183
Closed

Select object not work when cursor at the close pair #1077

QiBaobin opened this issue Nov 11, 2021 · 1 comment · Fixed by #1183
Assignees
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug

Comments

@QiBaobin
Copy link
Contributor

When the cursor is at the close pair of around object we want to select, it doesn't work. Nothing happens.

For example, when the cursor is at ], neithermi[ or ma[ works.

pub const PAIRS: &[(char, char)] = &[
    ('(', ')'),
    ('[', ']'),
    ('{', '}'),
    ('<', '>'),
    ('«', '»'),
    ('「', '」'),
    ('(', ')'),
];
_
@kirawi kirawi added A-core Area: Helix core improvements C-bug Category: This is a bug A-helix-term Area: Helix term improvements and removed A-core Area: Helix core improvements labels Nov 11, 2021
@archseer
Copy link
Member

\cc @sudormrfbin

@sudormrfbin sudormrfbin self-assigned this Nov 23, 2021
sudormrfbin added a commit to sudormrfbin/helix that referenced this issue Nov 28, 2021
Fixes helix-editor#1077. This was caused by the assumption that a block
cursor is represented as zero width internally and simply
rendered to be a single width selection, where as in reality
a block cursor is an actual single width selection in form and
function.

Behavioural changes:

1. Surround selection no longer works when cursor is _on_ a
    surround character that has matching pairs (like `'`
    or `"`). This was the intended behaviour from the start
    but worked till now because of the cursor position
    calculation mismatch.
archseer pushed a commit that referenced this issue Nov 29, 2021
Fixes #1077. This was caused by the assumption that a block
cursor is represented as zero width internally and simply
rendered to be a single width selection, where as in reality
a block cursor is an actual single width selection in form and
function.

Behavioural changes:

1. Surround selection no longer works when cursor is _on_ a
    surround character that has matching pairs (like `'`
    or `"`). This was the intended behaviour from the start
    but worked till now because of the cursor position
    calculation mismatch.
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.

4 participants