This question is locked. New answers and comments are not allowed.
Is there a way to have Surround with templates apply only to the selected text, and not the entire statement?
E.g. I needed to clean up some non-validating JSON, and essentially add double-quotes around the names. Here is my sample JSON:
var s = { one: 1, two: 2, three: 3}
And my template def:
"$STATEMENT_SELECTION$|"
If I highlight the word 'one' above and run the template, it puts quotes around the entire statement.
"var s = { one: 1, two: 2, three: 3}"
what I want is:
var s = { "one": 1, two: 2, three: 3}
Is there a way to do this with the current templating language? Otherwise I think it'd be helpful to add such capability to a future release, e.g. apply template to selection only.
E.g. I needed to clean up some non-validating JSON, and essentially add double-quotes around the names. Here is my sample JSON:
var s = { one: 1, two: 2, three: 3}
And my template def:
"$STATEMENT_SELECTION$|"
If I highlight the word 'one' above and run the template, it puts quotes around the entire statement.
"var s = { one: 1, two: 2, three: 3}"
what I want is:
var s = { "one": 1, two: 2, three: 3}
Is there a way to do this with the current templating language? Otherwise I think it'd be helpful to add such capability to a future release, e.g. apply template to selection only.