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

PopAround #72

Open
Gregoor opened this issue Dec 8, 2022 · 0 comments
Open

PopAround #72

Gregoor opened this issue Dec 8, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@Gregoor
Copy link
Owner

Gregoor commented Dec 8, 2022

A combination of unwrap, extend selection and wrap with what was previously removed by unwrapping. Afaik Paredit has a similar feature, sth like "barfing". Should look into it. Some examples

Examples

Ternary

In

a ? fn(≤b≥) : c

Out

fn(≤a ? b : c≥)

Array

In

{ a: [≤b≥], c }

Out

[{ a: b, c }]

Function Call

In

a ? f(≤b≥, c) : d

Out

f(a ? b : d, c) 

In

a ? f(b, ≤c≥) : d

Out

f(≤b, a ? c : d≥)

JSX

In

<ErrorBoundary
  fallback={<>An error occurred while searching. We are looking into it!</>}
>
  {term && results && <SearchResults {...{ term, results }} />}
</ErrorBoundary>;

Out

{
  term && results && (
    <ErrorBoundary
      fallback={<>An error occurred while searching. We are looking into it!</>}
    >
      <SearchResults {...{ term, results }} />
    </ErrorBoundary>
  );
}

 ¿Double Pop?

This one is a bit more involved, and maybe it's better solved with multi-selections, which Tofu can't do yet.

In

({ a: t ? ≤1≥ : 2, b: t ? "y" : "n" });

Out

t ? { a: 1, b: "y" } : { a: 2, b: "n" };
@Gregoor Gregoor added the enhancement New feature or request label Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant