Author Topic: 19.0.2 autosurrounding with quotes and parens  (Read 2331 times)

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
19.0.2 autosurrounding with quotes and parens
« on: March 12, 2015, 09:15:36 PM »
New in 19, when you have a selection and type a ", it puts quotes around the whole selection.


I forget what this is called, and it doesn't appear to have a feature notification.


I seem to run into the case pretty often where it does the wrong thing for me.
For example, given this line of code,

 
        printf("Hello there code\n"); 

I will select code\n");
then type ", arg1);
then result is

 
        printf("Hello there ", arg1);"

instead of what I wanted,

 
        printf("Hello there ", arg1); 

It should be a little smarter

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6866
  • Hero Points: 528
Re: 19.0.2 autosurrounding with quotes and parens
« Reply #1 on: March 13, 2015, 12:54:55 AM »
With this case, we could add code to look for a trailing quote. We could also bail if there is a leading or trailing occurrence of the quotes.

Do you have any other cases that frequently don't work for you.

This feature has a def var (def_auto_surround_chars) but is not available anywhere in the GUI yet. It still needs more work. Eventually it will work it's way into the GUI.