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

Strange behaviour when auto-pairing Unicode brackets #3964

Closed
Omnikar opened this issue Sep 25, 2022 · 1 comment · Fixed by #10688
Closed

Strange behaviour when auto-pairing Unicode brackets #3964

Omnikar opened this issue Sep 25, 2022 · 1 comment · Fixed by #10688
Labels
A-core Area: Helix core improvements C-bug Category: This is a bug R-duplicate Duplicated issue: please refer to the linked issue

Comments

@Omnikar
Copy link
Contributor

Omnikar commented Sep 25, 2022

Summary

The Lean programming language uses Unicode braces ⟨⟩, so I tried adding auto-pairing for them in my config and the cursor ended up moving in unexpected ways.

Reproduction Steps

  1. Add the following to languages.toml:
[[language]]
name = "lean"
[language.auto-pairs]
"⟨" = ""
  1. hx foo.lean
  2. Type

I expected this to happen:

is added after the cursor, and the cursor remains where it is, between and

Instead, this happened:

is added after the cursor, and the cursor moves 4 characters forward from where it should be.
For example, with | representing the cursor:

|
----

Type

⟨⟩
--|--

This behaviour causes Helix to panic if it happens close enough to the end of a file.

Helix log

Nothing of relevance

Platform

MacOS

Terminal Emulator

iTerm2 v3.4.16

Helix Version

helix 22.08.1 (42e30e7)

@Omnikar Omnikar added the C-bug Category: This is a bug label Sep 25, 2022
@kirawi kirawi added the A-core Area: Helix core improvements label Sep 25, 2022
@dead10ck
Copy link
Member

Duplicate of #3946

@dead10ck dead10ck marked this as a duplicate of #3946 Sep 25, 2022
@dead10ck dead10ck closed this as not planned Won't fix, can't repro, duplicate, stale Sep 25, 2022
@dead10ck dead10ck added the R-duplicate Duplicated issue: please refer to the linked issue label Sep 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Helix core improvements C-bug Category: This is a bug R-duplicate Duplicated issue: please refer to the linked issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants