# HG changeset patch # User Torsten Lilge # Date 1713713969 -7200 # Node ID b2333101ca29d83bedcdeee98e2d21e28a4ab26e # Parent 60772ed3e9203768f759734c3c60a49afb3cbd68 allow to run selected tests and demos by F9 (bug #65577) * octave-qscintilla.cc (contextmenu_run): remove %! from the beginning of a selected line except the keywords demo and test are following diff -r 60772ed3e920 -r b2333101ca29 libgui/src/m-editor/octave-qscintilla.cc --- a/libgui/src/m-editor/octave-qscintilla.cc Wed Mar 20 07:35:25 2024 +0100 +++ b/libgui/src/m-editor/octave-qscintilla.cc Sun Apr 21 17:39:29 2024 +0200 @@ -888,8 +888,13 @@ for (int i = 0; i < lines.count (); i++) { QString line = lines.at (i); + if (line.trimmed ().isEmpty ()) continue; + + if (! line.contains (QRegularExpression("^%!(demo|test)\\s*"))) + line.replace (QRegularExpression("^%!\\s"), ""); // allow running tests & demos + QString line_escaped = line; line_escaped.replace (QString ("'"), QString ("''")); QString line_history = line;