Mercurial > octave
changeset 33512:7afc314f2998
maint: Remove unnecessary indentation block in cset f31a0d826776.
* octave-qscintilla.cc (contextmenu_run): Remove extra parentheses creating
unnecessary context block. Tweak comments for clarity.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 02 May 2024 14:58:14 -0700 |
parents | f55315e0cfcc |
children | ec79204cfe38 |
files | libgui/src/m-editor/octave-qscintilla.cc |
diffstat | 1 files changed, 7 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/m-editor/octave-qscintilla.cc Thu May 02 14:27:32 2024 -0700 +++ b/libgui/src/m-editor/octave-qscintilla.cc Thu May 02 14:58:14 2024 -0700 @@ -894,14 +894,13 @@ if (line.startsWith ("%!")) // Handle tests and demos { - // Do not remove %! if keyword is directly following. - // Exception: assert - { - // assert might be used without leading space - line.replace (QRegularExpression("^%!assert(\\s*)([^\\s]+)"), "assert\\1\\2"); - // Remove "%! " - line.replace (QRegularExpression("^%!\\s+"), ""); - } + // Do not remove "%!" if keyword (e.g., "test", "demo", etc.) is + // directly following. Exception is "assert". + // assert might be used without leading space + line.replace (QRegularExpression ("^%!assert(\\s*)([^\\s]+)"), + "assert\\1\\2"); + // Remove "%! " from body of test/demo block + line.replace (QRegularExpression ("^%!\\s+"), ""); } QString line_escaped = line;