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: the paredit-wrap-around now support to select sexp at point without the need to move point to the beginning of sexp #1708

Merged
merged 4 commits into from
Dec 17, 2024

Conversation

sakurawald
Copy link
Contributor

@sakurawald sakurawald commented Dec 11, 2024

This pr does improve the implementation for paredit-wrap-around in buffer-mark-p = nil branch.

The pr contains:

  1. Simplify the impl by re-use the forward-sexp and backward-sexp funciton. (The end is where the forward-sexp point at, the start is where the backward-sexp point at.)
  2. Remove the handling of following-space. (It's handled by backward-sexp, after the eval of backward-sexp, the current-point are guarantee to at the first char of sexp.)
  3. Support to select the sexp at current point as a whole unit.
  4. Always insert 1 space before the first char of sexp, and move current-point at it. (Now it's more smooth to chain-call functions, the space is inserted there.)
  5. Treat the open char, string between open-char and closed-char and closed char as the same form. (Fix issue like: The level in paired open-parenthesis and closed-parenthesis is not identical. #1612)

Let's asume your current-point is inside the word second, the paredit-wrap can now treat the second as a whole sexp, without the need to move current-point to the ( or first-char of sexp

Before this pr
Screenshot_20241211_092556

After this pr
image

…without the need to move point to the beginning of sexp
@sakurawald sakurawald changed the title feature: the paredit-wrap-around now support to select sexp at point without the need to move point to the beginning of sexp [DRAFT] feature: the paredit-wrap-around now support to select sexp at point without the need to move point to the beginning of sexp Dec 11, 2024
@sakurawald sakurawald changed the title [DRAFT] feature: the paredit-wrap-around now support to select sexp at point without the need to move point to the beginning of sexp feature: the paredit-wrap-around now support to select sexp at point without the need to move point to the beginning of sexp Dec 11, 2024
@cxxxr cxxxr merged commit 3e64ef5 into lem-project:main Dec 17, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants