Author Topic: Adaptive paste (function names in strings)  (Read 310 times)

pmwhite

  • Community Member
  • Posts: 98
  • Hero Points: 7
Adaptive paste (function names in strings)
« on: May 03, 2012, 10:17:59 pm »
How ambitious would it be to support the following? Suppose I have this method:

void SomeClass::method1 {
   cout << "SomeClass::method1 invoked" << endl;
   // ... something here ...
}

I also have another method, method2, and I want to copy the first line of method1 into it.

Could SlickEdit realize what's going on and on the fly modify the string to reference "method2" instead?

I understand that this behavior may not always be preferable or correct, but I think it's a frequent enough scenario that maybe there can be a "Adaptive paste" option or somesuch to make it happen. You already perform "Adaptive formatting" when pasting to make the pasted content fit the destination. This is a step further.

lambertia

  • Senior Community Member
  • Posts: 382
  • Hero Points: 14
  • I have nothing sufficiently witty to say.
Re: Adaptive paste (function names in strings)
« Reply #1 on: May 04, 2012, 06:16:18 am »
How ambitious would it be to support the following? Suppose I have this method:

void SomeClass::method1 {
   cout << "SomeClass::method1 invoked" << endl;
   // ... something here ...
}

I also have another method, method2, and I want to copy the first line of method1 into it.

Could SlickEdit realize what's going on and on the fly modify the string to reference "method2" instead?

I understand that this behavior may not always be preferable or correct, but I think it's a frequent enough scenario that maybe there can be a "Adaptive paste" option or somesuch to make it happen. You already perform "Adaptive formatting" when pasting to make the pasted content fit the destination. This is a step further.

In this case I'd probably go:

Code: [Select]
void SomeClass::method1 {
   cout << __FUNCTION__ << endl;
   // ... something here ...
}

;)

Nice idea though! I like it.
--
Greg.