Make Ctrl-Mouse open an included file for editing.

It might be nice to do this also for other insets that allow editing.
To do that properly, we'd want to standardize how such insets call an
external (or internal) program, which I guess would mean a virtual
method corresponding to editIncluded. When it exists (i.e., isn't null),
then we could call it, and we'd only need one centralized method to do
that. But at the moment, we have editGraphics, etc.
This commit is contained in:
Richard Kimberly Heck 2019-04-26 21:59:52 -04:00
parent 276ffc262c
commit c286228315

View File

@ -318,6 +318,16 @@ void InsetInclude::doDispatch(Cursor & cur, FuncRequest & cmd)
break;
}
case LFUN_MOUSE_RELEASE: {
if (cmd.modifier() == ControlModifier) {
FileName const incfile = includedFileName(buffer(), params());
string const & incname = incfile.absFileName();
editIncluded(incname);
break;
}
}
// fall through
//pass everything else up the chain
default:
InsetCommand::doDispatch(cur, cmd);