medit/moo/mooedit/context.xml

34 lines
620 B
XML

<tools>
<tool name="_Switch Header And Implementation">
<langs>C, GAP</langs>
<command type="MooScript" options="need-file">
<code>extensions = [[['.h', '.hh', '.hpp', '.hxx', '.H'], ['.c', '.cc', '.cpp', '.cxx', '.C']],
[['.gd'], ['.gi']]];
new = none;
for p in extensions do
if doc.ext in p[0] then
new = p[1];
break;
elif doc.ext in p[1] then
new = p[0];
break;
fi;
od;
if not new then
return;
fi;
for e in new do
file = doc.dir + '/' + doc.base + e;
if FileExists(file) then
Open(file);
return;
fi;
od;
</code>
</command>
</tool>
</tools>