Giter VIP home page Giter VIP logo

calva-paredit's People

Contributors

anticrisis avatar avfonarev avatar dentrado avatar gclapperton avatar martinholloway1970 avatar pez avatar yogthos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

calva-paredit's Issues

Slurp sexp forward should be able to "push" multiple layers of close delimiters.

I'm using Emacs paredit as the model here:

Given something like this:

(let [x 1])
(println x)

When the cursor is positioned immediately after the 1, slurp-sexp-forward should first push the outermost ) forward to yield this:

(let [x 1]
 (println x))

(In current implementation, slurp-sexp-forward does nothing when the cursor is inside the let binding.)

A second execution of slurp-sexp-forward should then push the ] forward to yield the valid sexp:

(let [x 1
  (println x)])

I know this is not useful, but that's an effect of the simplified example I'm using.

Add support for switching between strict and non-strict mode

This is a feature request for strict mode. In strict mode, paredit does not allow you to delete any open/close parenthesis without also deleting their corresponding close/open parenthesis. This has been implemented in Cursive and other paredit plugins for other editors. Are there are plans to add support for this here? If this is something that you would like to implement, how can I help?

Cannot disable paredit without disabling calva

Thanks for a great plugin! I'd like to use Calva without Paredit, any chance for that to happen? Now when trying to disable Calva Paredit, VSCode throws the following error:

Cannot disable extension 'Calva Paredit'. Extension 'Calva: Clojure & Clojurescript interactive programming made easy' depends on this.

I'm on vscode 1.28.0, Calva 1.3.44 and Calva Paredit 0.1.15.

In strict mode, backspace should "walk inside" delimiters

I'm using Emacs paredit as my model here:

Given an sexpr like

(testing "Define schema"| 
   ,,,)

Where the | represents the cursor position.

Pressing backspace should not delete the " because that would unbalance the form. However, it should step backward inside the quoted string and delete the last character there, yielding:

(testing "Define schem|" 
   ,,,)

That means pressing backspace repeatedly will eventually delete the entire contents of the string, leaving

(testing "|"
   ,,,)

At which point, the next backspace would remove the paired delimiters (just as it works today. πŸ˜ƒ )

Backspace is prohibited when a newline is in the selection

Expected Behavior

As long as backspace does not cause an unbalanced form, it should delete the contents of the selection.

Actual Behavior

A selection that includes one or more newlines causes an error with the message Running the contributed command: 'paredit.deleteBackward' failed.

Additional information

This certainly occurs in strict mode. I have not verified whether it also occurs in non-strict mode.

Pressing DEL results in a similar error, for the command paredit.deleteForward.

Unusual behavior with wrap in the middle of a leaf sexp

When the cursor is in the middle of a leaf sexp (I'll use a keyword in the examples), I'd expect it to wrap the whole sexp
examples:

  • when it's the last sexp inside another sexp
{:bar :fo|o}
{:bar :fo()o}
  • when there is a following sexp
{:fo|o :bar}
{:fo(o :bar)}
  • when the cursor is at the beggining of the sexp it works fine
{|:foo :bar}
{(:foo) :bar}

Kill Sexp Forward/Backward not working correct

When i try to delete some sexp and it is on multiple lines it does not work right.

For example:

(defn test []
  (println "test"))

So when i kill the println it works correct but when i try to kill the whole function the result is:

  (println "test"))

The same is when i put the string on the next line and try to kill the println expression.

I use the current version for paredit (0.1.9) with VS Code 1.24.1 on windows and didn't tried it on linux.

Indentation fails

The Paredit: indent command does not work. It gives an error message from Code instead.

Feature request: raise sexp

several times I need to do the following when refactoring my code

(let [...]
 |(my-fn ...)
  (other-fns ...)

raise

|(my-fn ...)

This is a feature that I used a lot on emacs, but I recon that it might not be a priority here since you are too few people to maintain all the calva extensions. BTW, thanks again for the great work

Strict mode prohibits ”legal” deletions of selected text

Hitting backspace with (foo) selected:

Expected: (foo) is deleted.

Actual: (foo) is not deleted and the cursor is moved to the end of the selection.

Further: If the selection starts at end of (foo) (the user selects from there and to the start of the text), and you hit backspace, then the character before (foo) is deleted (if allowed by struct mode).

Preferrably strict mode should refuse to delete the selection if it would unbalance things and leave the selection intact. Otherwise just delete the selection. This is how the demo of paredit.js behaves.

Second best would be to not use strict mode for selection deletions. (Quite a lot less best than remaining strict, but anyway.)

Add forwardUpSexp

backwardUpSexp is already present, so I'd really like to have forwardUpSexp as well

[Improvement] Less picky about cursor placement

There appear to be a few offenders I care about.

Take the form (inc map)

Transpose will only work if the cursor is on , or m. Ideally (imo) it should work with the cursor on m,a,p, and do nothing on .

All of the wrap functions and all of the kill functions have this issue as well.

It seems you can sort of get around this with custom keybindings (stringing forwardSexp, backwardSexp, and eg transpose together), but that has the unfortunate side-effect of unexpectedly moving your cursor.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.