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

mr"“/mr"” replaces double quotes with two pairs of the same kind of double quote #10966

Closed
adiabatic opened this issue Jun 15, 2024 · 1 comment · Fixed by #10971
Closed
Labels
C-bug Category: This is a bug E-has-instructions Call for participation: Has instructions for fixing the issue and opening a PR

Comments

@adiabatic
Copy link
Contributor

Summary

I added the following to my helix config:

[editor.auto-pairs]
'(' = ')'
'{' = '}'
'[' = ']'
'"' = '"'
"'" = "'"
'“' = ''
# ’ is usually an apostrophe
'«' = '»'
'`' = '`'

and tried to replace straight double quotes with curly double quotes. However, instead of getting leading and trailing double quotes, I got two of the same kind of whatever I typed in.

I tried this with mr"« and mr"» and it didn't screw up like this. It worked right for the guillemets.

Reproduction Steps

I tried this:

  1. run hx.
  2. insert "Do they allow sheep on the airplane?" into the buffer however you like.
  3. Get into normal mode by pressing escape.
  4. type mr"“ (⎄"< works, where ⎄ is your Compose key, or type ⌥[ in macOS)

I expected this to happen:

Both the leading and trailing double quotes should be curled differently from each other.

Instead, this happened:

Both the leading and trailing double quotes are curled the same way (in this case, leading).

Helix log

~/.cache/helix/helix.log
2024-03-22T23:26:40.960 helix_view::editor [ERROR] Failed to initialize the language servers for `source.md` - `marksman` { cannot find binary path }
2024-04-19T00:20:24.456 helix_core::syntax [ERROR] Failed to load tree-sitter parser for language "gemini": Error opening dynamic library "/home/linuxbrew/.linuxbrew/Cellar/helix/24.03/bin/runtime/grammars/gemini.so"
2024-06-14T23:22:03.428 helix_core::syntax [ERROR] Failed to load tree-sitter parser for language "gemini": Error opening dynamic library "/home/linuxbrew/.linuxbrew/Cellar/helix/24.03/bin/runtime/grammars/gemini.so"

Platform

macOS and Linux (Debian Stable)

Terminal Emulator

Terminal.app, iTerm2.app, gnome-terminal

Installation Method

Homebrew (on both macOS and Debian)

Helix Version

24.3 (Homebrew says 24.03 in both cases, though)

@adiabatic adiabatic added the C-bug Category: This is a bug label Jun 15, 2024
@the-mikedavis
Copy link
Member

The bracket pairs for matching are controlled by

pub const BRACKETS: [(char, char); 7] = [
('(', ')'),
('{', '}'),
('[', ']'),
('<', '>'),
('«', '»'),
('「', '」'),
('(', ')'),
];
rather than auto-pairs config. It should be enough to add the angled brackets to that list to fix this.

@the-mikedavis the-mikedavis added the E-has-instructions Call for participation: Has instructions for fixing the issue and opening a PR label Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug E-has-instructions Call for participation: Has instructions for fixing the issue and opening a PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants