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 delete pair before the cursor #338

Closed
wants to merge 5 commits into from
Closed

Add delete pair before the cursor #338

wants to merge 5 commits into from

Conversation

altermo
Copy link
Contributor

@altermo altermo commented Mar 8, 2023

This PR adds the feature to delete pair () before the cursor.
Example: ()| > <bs> > |

@ribru17
Copy link
Contributor

ribru17 commented Apr 2, 2023

Please make this feature opt in if you end up adding it I think it can be quite annoying sometimes (though unintentionally)

@BingCoke
Copy link

BingCoke commented Jun 5, 2023

Please make this feature opt in if you end up adding it I think it can be quite annoying sometimes (though unintentionally)

Each has its pros and cons. such as "some(other()<|>)" when i input twice will get => "some(other".

but it seems add a opt
image
I hope it cloud be merg into master

@ribru17
Copy link
Contributor

ribru17 commented Jul 8, 2023

Maybe you are right about opting in then, I suppose more useful than harmful

@ribru17
Copy link
Contributor

ribru17 commented Sep 6, 2023

I think you are right that this should be enabled by default 👍 sorry my mistake

@ribru17
Copy link
Contributor

ribru17 commented Sep 6, 2023

Also I was wondering: is this PR any different from doing a rule such as this?

Rule(bracket[1] .. bracket[2], '')
    :with_pair(function() return false end),

where bracket would just be some table iterating over each pair of brackets, i.e. (, ), [, ], etc. This rule adds a delete for such a pair without inserting a pairing or moving

@ribru17
Copy link
Contributor

ribru17 commented Sep 6, 2023

Sorry, going to stop bugging now: just realized you are the author of the new autopair plugin! Thanks for creating, going to check it out now.

@altermo
Copy link
Contributor Author

altermo commented Sep 6, 2023

Okay, I enabled it by default.
Also, it is probably the same as the rule you talk about, with the only difference being that you need to refactor some of the functions you pass to cond, though I haven't looked into it too much.

Copy link

stale bot commented Nov 11, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Nov 11, 2023
@altermo altermo closed this Nov 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants