]> git.lyx.org Git - features.git/commitdiff
Make Ctrl-Mouse open an included file for editing.
authorRichard Kimberly Heck <rikiheck@lyx.org>
Sat, 27 Apr 2019 01:59:52 +0000 (21:59 -0400)
committerRichard Kimberly Heck <rikiheck@lyx.org>
Sat, 27 Apr 2019 02:05:42 +0000 (22:05 -0400)
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.

src/insets/InsetInclude.cpp

index 78da0cb6c2286e3c171f1ac8490cb4f36d77dc4b..530adfcf416087349ccc407edbc47fd78750763d 100755 (executable)
@@ -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);