Code::Blocks

User forums => General (but related to Code::Blocks) => Topic started by: Alfred96 on October 09, 2018, 08:37:17 am

Title: Simultaneous rename
Post by: Alfred96 on October 09, 2018, 08:37:17 am
If I have something like:
Code: [Select]
template<class Int_T,class Int_Y>
auto operator+(const Int<Int_T>& left, const Int<Int_Y>& right)
->Int<typename if_<!std::is_same<Int<Int_T>,Int<Int_Y>>::value,
                   Choose_Larger<Int<Int_T>,Int<Int_Y>>,
                   Promote<Int<Int_T>>
                  >::type
     >
{
    return add(left,right);
}
And I decided that for clarity I would like to change Int_T to simply A and Int_Y to just B I see that at the moment those references are being "highligted" but I don't think I can do anything with those multiple selections? Is there a way that I just select one (the other ones are get highlighted) and I change just this one I've selected and the other ones are get automatically changed?
Thanks.
Title: Re: Simultaneous rename
Post by: oBFusCATed on October 09, 2018, 09:09:16 am
If you have enabled editing in multiple selections (not enabled by default).
You can press ctrl-e (edit -> select next occurrence) multiple times to select them all and then you can just type your new name.

There is also an Edit -> Select all command, but this select every occurrence in the whole file.
Title: Re: Simultaneous rename
Post by: BlueHazzard on October 09, 2018, 09:41:00 am
Why not search and replace all?
Title: Re: Simultaneous rename
Post by: oBFusCATed on October 09, 2018, 10:52:17 am
Because it will be slower :) And it might replace something you don't see.