Author Topic: Open Opposite (Alt-O) - what did it suppose to do?  (Read 2715 times)

Offline Arthur

  • Registered User
  • Hero Member
  • *
  • Posts: 653
  • Karma: +1/-0
  • He who is ashamed of asking is afraid of learning.
    • My Blog
Open Opposite (Alt-O) - what did it suppose to do?
« on: August 04, 2009, 10:20:06 PM »
Open Opposite (Alt-O) - what did it suppose to do?

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2224
  • Karma: +37/-3
    • HippoEDIT
Re: Open Opposite (Alt-O) - what did it suppose to do?
« Reply #1 on: August 06, 2009, 02:06:52 PM »
Hi Arthur,

Open Opposite - opens pair file. It is not relevant to all syntaxes, but for that which has pair file mask maintained (fex C++, header and implementation files):
Code: [Select]
      <FilePattern mask="*.c;*.cpp;*.cxx;*.hpp;*.hxx;*.inl;*.h">
        <Pair file1="*.cpp" file2="*.h"/>
        <Pair file1="*.cxx" file2="*.h"/>
        <Pair file1="*.cxx" file2="*.hpp"/>
        <Pair file1="*.inl" file2="*.h"/>
        <Pair file1="*.c" file2="*.h"/>
        <Pair file1="*.cc" file2="*.hh"/>
      </FilePattern>

How it works: if you have file test.cpp open and press Open Opposite HE would try to open file test.h, if you do the same with test.h would be open test.cpp. And so on for all combinations of pairs. Maybe for Visual Basic it can be vb file and *.frm file, but name (without extension) should match. If somebody knows cases where logic can be reused or beautified, share it and would do my best ;)

Best regards,
Alex.

Offline Arthur

  • Registered User
  • Hero Member
  • *
  • Posts: 653
  • Karma: +1/-0
  • He who is ashamed of asking is afraid of learning.
    • My Blog
Re: Open Opposite (Alt-O) - what did it suppose to do?
« Reply #2 on: August 06, 2009, 04:17:35 PM »
Got it, thank you, it is an interesting piece of previously unknown to me functionality!
I suggest it be named differently, the reflect its purpose, perhaps say Open Related File?

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2224
  • Karma: +37/-3
    • HippoEDIT
Re: Open Opposite (Alt-O) - what did it suppose to do?
« Reply #3 on: August 06, 2009, 05:20:59 PM »
Yes, you are right. It was called like this because of the same name used in Visual Assist.
But now I see that they have also renamed it to Open Corresponding File, so maybe because of the consistency I would take same name.