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 option to keep text more fully formatted as you type #1406

Closed
PEZ opened this issue Dec 1, 2021 · 1 comment
Closed

Add option to keep text more fully formatted as you type #1406

PEZ opened this issue Dec 1, 2021 · 1 comment

Comments

@PEZ
Copy link
Collaborator

PEZ commented Dec 1, 2021

Currently, when formatOnType is enabled Calva does only indenting. And it only happens when new lines are entered.

We should have an option where the text is formatted as when new lines are entered, e.g.:

(def colt-express
  {:name "Colt Express"
   :categories ["Family"
                "Strategy"]
   :play-time 40
   :ratings |{:pez 5.0
              :kat 5.0
              :wiw 5.0
              :vig 3.0
              :rex 5.0
              :lun 4.0}})

enter =>

(def colt-express
  {:name "Colt Express"
   :categories ["Family"
                "Strategy"]
   :play-time 40
   :ratings
  |{:pez 5.0
    :kat 5.0
    :wiw 5.0
    :vig 3.0
    :rex 5.0
    :lun 4.0}})

Saving you one reason to press tab to format it after you have entered the new line.

It should also work as text is entered and deleted more generally. E.g. (the two vertical bars indicating a selection):

(def colt-express
  {:name "Colt Express"
   :categories ["Family"
                "Strategy"]
   :play-time 40
   :ratings|-foo-bar| {:pez 5.0
                       :kat 5.0
                       :wiw 5.0
                       :vig 3.0
                       :rex 5.0
                       :lun 4.0}})

backspace =>

(def colt-express
  {:name "Colt Express"
   :categories ["Family"
                "Strategy"]
   :play-time 40
   :ratings| {:pez 5.0
              :kat 5.0
              :wiw 5.0
              :vig 3.0
              :rex 5.0
              :lun 4.0}})

This has further implications and corner cases and such, but this should capture the gist of the feature.

@PEZ PEZ added the formatting label Dec 1, 2021
@PEZ
Copy link
Collaborator Author

PEZ commented Dec 1, 2021

OK. So I forgot to close this via the PR.

@PEZ PEZ closed this as completed Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant