textmate / json.tmbundle

TextMate support for JSON
122 stars 26 forks source link

Add Reformat Document / Selection without encoding #15

Closed milligramme closed 8 years ago

milligramme commented 9 years ago

enhanced "Reformat Document / Selection" like below

source.json

{
    "hello": {
        "en": "Hello World!",
        "ru": "привет мир!",
        "ja": "こんにちは 世界!"
    }
}

Reformat Document / Selection

{
    "hello": {
        "en": "Hello World!",
        "ja": "\u3053\u3093\u306b\u3061\u306f\u3000\u4e16\u754c\uff01",
        "ru": "\u043f\u0440\u0438\u0432\u0435\u0442 \u043c\u0438\u0440!"
    }
}

Reformat Document / Selectionwithout encoding( this PR )

{
    "hello": {
        "en": "Hello World!",
        "ru": "привет мир!",
        "ja": "こんにちは 世界!"
    }
}
infininight commented 8 years ago

Took some time trying to get the python version working since this requires ruby 2.0 but was unsuccessful. Don't really like the idea of having duplicate commands so we are just going to allow this command to require 10.9. The number of people on 10.8 is very low and the number that will run into this missing command is even smaller so shouldn't be too much of an issue. (It will present an error message on those systems.)

I also did a followup commit to support the current indent method/size.

Thanks!