diff libgui/src/main-window.cc @ 25925:e9c24b5e8673

fix opening a function file with an error in a nested function (bug #54801) * main-window.cc (handle_edit_mfile_request): split given function name at character > and only take the part as function file to open
author Torsten <mttl@mailbox.org>
date Thu, 11 Oct 2018 18:46:05 +0200
parents a7511a1489b8
children 332be8be16eb
line wrap: on
line diff
--- a/libgui/src/main-window.cc	Mon Oct 08 23:04:24 2018 +0200
+++ b/libgui/src/main-window.cc	Thu Oct 11 18:46:05 2018 +0200
@@ -1120,13 +1120,16 @@
     interpreter& interp
       = __get_interpreter__ ("main_window::clear_workspace_callback");
 
+    // Split possible subfuntions
+    QStringList fcn_list = fname.split ('>');
+    QString fcn_name = fcn_list.at (0) + ".m";
+
     // Is it a regular function within the search path? (Call Fexist)
     octave_value_list fct = Fexist (interp, ovl (fname.toStdString ()),0);
     int type = fct (0).int_value ();
 
     QString message = QString ();
     QString filename = QString ();
-    QString fcn_name = fname + ".m";
 
     switch (type)
       {