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

Feature/dwim kill region #873

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Feature/dwim kill region #873

wants to merge 2 commits into from

Conversation

Fuco1
Copy link
Owner

@Fuco1 Fuco1 commented Mar 16, 2018

  • Does not work with a selected region and backspace (some of the delsel hacks need to be updated)
  • Let people in https://github.com/luxbock/evil-cleverparens and evil-smartparens know about the new API, they rely on that to do some vim magic :)

Related to #867

@@ -9030,7 +9058,13 @@ If that text is unbalanced, signal an error instead.
With a prefix argument, skip the balance check."
(interactive "r")
(when (or current-prefix-arg
(sp-region-ok-p beg end)
(-let [(&plist :ok ok :last-good-sexp last-good-sexp) (sp-get-region-info beg end)]
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should extract this new block into a separate function as it will be reused multiple times

@@ -9054,28 +9088,47 @@ of the point."
(indent-sexp))
(sp--back-to-indentation column indentation))))

(cl-defun sp-region-ok-p (start end)
"Test if region between START and END is balanced.
(defun sp-get-region-info (start end)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Document this somewhere (check if region-ok-p was documented)

@Fuco1 Fuco1 added this to the October batch milestone Nov 11, 2018
@Fuco1 Fuco1 removed this from the October batch milestone Apr 3, 2024
@Fuco1 Fuco1 self-assigned this Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

1 participant