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

add support for autopairs of certain keys #1014

Closed
LollipopFt opened this issue Nov 8, 2021 · 5 comments · Fixed by #1219
Closed

add support for autopairs of certain keys #1014

LollipopFt opened this issue Nov 8, 2021 · 5 comments · Fixed by #1219
Labels
A-helix-term Area: Helix term improvements C-enhancement Category: Improvements

Comments

@LollipopFt
Copy link
Contributor

Describe your feature request

allow autopairs of " and ' keys
personally i think the first one: " is most commonly used for strings, and should thus be autopaired.
second one: ' can sometimes be used in lifetime annotations i guess, so not necessary to add this one.

@LollipopFt LollipopFt added the C-enhancement Category: Improvements label Nov 8, 2021
@LollipopFt
Copy link
Contributor Author

oops didn't notice this issue: #992

@archseer
Copy link
Member

archseer commented Nov 8, 2021

#995 solves this, got merged today

@archseer archseer closed this as completed Nov 8, 2021
@LollipopFt
Copy link
Contributor Author

LollipopFt commented Nov 8, 2021

hi @archseer , this did not seem to be resolved:

https://user-images.githubusercontent.com/62802897/140758409-4523723a-aff8-47ce-a251-8a6140b438c6.mp4
there is still no autopair for ", and i still needed to add the second " individually.

@archseer
Copy link
Member

archseer commented Nov 8, 2021

Ah sorry, I confused auto-pairs and match-brackets.

@archseer archseer reopened this Nov 8, 2021
@kirawi kirawi added the A-helix-term Area: Helix term improvements label Nov 10, 2021
@dead10ck
Copy link
Member

If folks don't mind a kind of slow pace, I'd like to take a crack at this and #992. I've been looking over the basics of the code base, and I think I'm at a place now where I could work on this. I just don't have a ton of free time, so it may be days between bits of work.

If anyone sees this and gets impatient, please feel free to go your own way independent of me.

dead10ck added a commit to dead10ck/helix that referenced this issue Nov 23, 2021
@LollipopFt LollipopFt reopened this Nov 27, 2021
dead10ck added a commit to dead10ck/helix that referenced this issue Nov 28, 2021
dead10ck added a commit to dead10ck/helix that referenced this issue Nov 29, 2021
dead10ck added a commit to dead10ck/helix that referenced this issue Dec 2, 2021
* Add unit tests for all existing functionality
* Add auto pairs for same-char pairs (quotes, etc). Account for
  apostrophe in prose by requiring both sides of the cursor to be
  non-pair chars or whitespace. This also incidentally will work for
  avoiding a double single quote in lifetime annotations, at least until
  <> is added
* Slight factor of moving the cursor transform of the selection to
  inside the hooks. This will enable doing auto pairing with selections,
  and fixing the bug where auto pairs destroy the selection.

Fixes helix-editor#1014
dead10ck added a commit to dead10ck/helix that referenced this issue Dec 2, 2021
* Add unit tests for all existing functionality
* Add auto pairs for same-char pairs (quotes, etc). Account for
  apostrophe in prose by requiring both sides of the cursor to be
  non-pair chars or whitespace. This also incidentally will work for
  avoiding a double single quote in lifetime annotations, at least until
  <> is added
* Slight factor of moving the cursor transform of the selection to
  inside the hooks. This will enable doing auto pairing with selections,
  and fixing the bug where auto pairs destroy the selection.

Fixes helix-editor#1014
dead10ck added a commit to dead10ck/helix that referenced this issue Dec 3, 2021
* Add unit tests for all existing functionality
* Add auto pairs for same-char pairs (quotes, etc). Account for
  apostrophe in prose by requiring both sides of the cursor to be
  non-pair chars or whitespace. This also incidentally will work for
  avoiding a double single quote in lifetime annotations, at least until
  <> is added
* Slight factor of moving the cursor transform of the selection to
  inside the hooks. This will enable doing auto pairing with selections,
  and fixing the bug where auto pairs destroy the selection.

Fixes helix-editor#1014
dead10ck added a commit to dead10ck/helix that referenced this issue Dec 3, 2021
* Add unit tests for all existing functionality
* Add auto pairs for same-char pairs (quotes, etc). Account for
  apostrophe in prose by requiring both sides of the cursor to be
  non-pair chars or whitespace. This also incidentally will work for
  avoiding a double single quote in lifetime annotations, at least until
  <> is added
* Slight factor of moving the cursor transform of the selection to
  inside the hooks. This will enable doing auto pairing with selections,
  and fixing the bug where auto pairs destroy the selection.

Fixes helix-editor#1014
dead10ck added a commit to dead10ck/helix that referenced this issue Dec 3, 2021
* Add unit tests for all existing functionality
* Add auto pairs for same-char pairs (quotes, etc). Account for
  apostrophe in prose by requiring both sides of the cursor to be
  non-pair chars or whitespace. This also incidentally will work for
  avoiding a double single quote in lifetime annotations, at least until
  <> is added
* Slight factor of moving the cursor transform of the selection to
  inside the hooks. This will enable doing auto pairing with selections,
  and fixing the bug where auto pairs destroy the selection.

Fixes helix-editor#1014
dead10ck added a commit to dead10ck/helix that referenced this issue Dec 3, 2021
* Add unit tests for all existing functionality
* Add auto pairs for same-char pairs (quotes, etc). Account for
  apostrophe in prose by requiring both sides of the cursor to be
  non-pair chars or whitespace. This also incidentally will work for
  avoiding a double single quote in lifetime annotations, at least until
  <> is added
* Slight factor of moving the cursor transform of the selection to
  inside the hooks. This will enable doing auto pairing with selections,
  and fixing the bug where auto pairs destroy the selection.

Fixes helix-editor#1014
dead10ck added a commit to dead10ck/helix that referenced this issue Dec 4, 2021
* Add unit tests for all existing functionality
* Add auto pairs for same-char pairs (quotes, etc). Account for
  apostrophe in prose by requiring both sides of the cursor to be
  non-pair chars or whitespace. This also incidentally will work for
  avoiding a double single quote in lifetime annotations, at least until
  <> is added
* Slight factor of moving the cursor transform of the selection to
  inside the hooks. This will enable doing auto pairing with selections,
  and fixing the bug where auto pairs destroy the selection.

Fixes helix-editor#1014
dead10ck added a commit to dead10ck/helix that referenced this issue Dec 6, 2021
* Add unit tests for all existing functionality
* Add auto pairs for same-char pairs (quotes, etc). Account for
  apostrophe in prose by requiring both sides of the cursor to be
  non-pair chars or whitespace. This also incidentally will work for
  avoiding a double single quote in lifetime annotations, at least until
  <> is added
* Slight factor of moving the cursor transform of the selection to
  inside the hooks. This will enable doing auto pairing with selections,
  and fixing the bug where auto pairs destroy the selection.

Fixes helix-editor#1014
dead10ck added a commit to dead10ck/helix that referenced this issue Dec 8, 2021
* Add unit tests for all existing functionality
* Add auto pairs for same-char pairs (quotes, etc). Account for
  apostrophe in prose by requiring both sides of the cursor to be
  non-pair chars or whitespace. This also incidentally will work for
  avoiding a double single quote in lifetime annotations, at least until
  <> is added
* Slight factor of moving the cursor transform of the selection to
  inside the hooks. This will enable doing auto pairing with selections,
  and fixing the bug where auto pairs destroy the selection.

Fixes helix-editor#1014
dead10ck added a commit to dead10ck/helix that referenced this issue Dec 12, 2021
* Add unit tests for all existing functionality
* Add auto pairs for same-char pairs (quotes, etc). Account for
  apostrophe in prose by requiring both sides of the cursor to be
  non-pair chars or whitespace. This also incidentally will work for
  avoiding a double single quote in lifetime annotations, at least until
  <> is added
* Slight factor of moving the cursor transform of the selection to
  inside the hooks. This will enable doing auto pairing with selections,
  and fixing the bug where auto pairs destroy the selection.

Fixes helix-editor#1014
archseer pushed a commit that referenced this issue Dec 13, 2021
* Add auto pairs for same-char pairs

* Add unit tests for all existing functionality
* Add auto pairs for same-char pairs (quotes, etc). Account for
  apostrophe in prose by requiring both sides of the cursor to be
  non-pair chars or whitespace. This also incidentally will work for
  avoiding a double single quote in lifetime annotations, at least until
  <> is added
* Slight factor of moving the cursor transform of the selection to
  inside the hooks. This will enable doing auto pairing with selections,
  and fixing the bug where auto pairs destroy the selection.

Fixes #1014
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-enhancement Category: Improvements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants