Coder Social home page Coder Social logo

Format a single line? about json-reformat HOT 9 CLOSED

gongo avatar gongo commented on July 30, 2024
Format a single line?

from json-reformat.

Comments (9)

gongo avatar gongo commented on July 30, 2024

Hi @arichiardi

Thanks for proposal.
But I can not imagine what kind of movement you expect to json-reformat-line.
Could you tell me what you are expecting for that function?

e.g.

Before:

2017-04-22 10 42 43

After(1):

2017-04-22 10 42 36

After(2):

2017-04-22 10 42 23

other..?

from json-reformat.

arichiardi avatar arichiardi commented on July 30, 2024

from json-reformat.

arichiardi avatar arichiardi commented on July 30, 2024

Probably after (1) is the less surprising of the two.

from json-reformat.

gongo avatar gongo commented on July 30, 2024

If you use js-mode , js-indent-line is assigned to indent-line-function.

from json-reformat.

arichiardi avatar arichiardi commented on July 30, 2024

I am using js2-mohe and for some reason it keeps indenting 4 spaces instead of 2.

from json-reformat.

gongo avatar gongo commented on July 30, 2024

When js2-mode, js2-indent-line is assigned.

https://github.com/mooz/js2-mode/blob/master/js2-mode.el#L101-L105

from json-reformat.

arichiardi avatar arichiardi commented on July 30, 2024

I see, but wouldn't be better to have consistency? I think what I see now is that when I use yours it uses one kind of formatting and when I use js2's I get another. I am also very familiar with Emacs internals so I might actually give this a shot sooner or later.

from json-reformat.

gongo avatar gongo commented on July 30, 2024

to have consistency?

I think there is a consistent between json-reformat and js-mode (js2-mode) if those indent-level equal.

(setq json-reformat:indent-width 4)
(setq js2-basic-offset 4)

from json-reformat.

arichiardi avatar arichiardi commented on July 30, 2024

I thought I tried that, I will try again.

from json-reformat.

Related Issues (20)

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.