Surround with selection only

3 posts, 1 answers
  1. deesnider
    deesnider avatar
    14 posts
    Member since:
    Nov 2008

    Posted 15 Nov 2012 Link to this post

    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.
  2. Answer
    Zdravko
    Admin
    Zdravko avatar
    657 posts

    Posted 20 Nov 2012 Link to this post

    Hello,

     Thanks for contacting us.
    Unfortunately, there isn't a way to do this so far. But you can post a feature request at our our new feedback portal and vote for it. The most popular and important requests will be targeted for implementation.

    Thanks.

    Greetings,
    Zdravko
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. deesnider
    deesnider avatar
    14 posts
    Member since:
    Nov 2008

    Posted 24 Nov 2012 Link to this post

Back to Top