# HG changeset patch # User Torsten Lilge # Date 1648846938 -7200 # Node ID a1c2ea6deaa48fa0e8160589536e47de722366ce # Parent 2bb53974669765df72ad30cbf089c8b4b980f414 fix err messages when running selected code while in dbg mode (bug #62105) * octave-qscintilla.cc (contextmenu_run): when in debug mode, remove line and column number from error message also for stack size two and drop another stack level from the error message diff -r 2bb539746697 -r a1c2ea6deaa4 libgui/src/m-editor/octave-qscintilla.cc --- a/libgui/src/m-editor/octave-qscintilla.cc Thu Mar 31 13:30:03 2022 +0200 +++ b/libgui/src/m-editor/octave-qscintilla.cc Fri Apr 01 23:02:18 2022 +0200 @@ -948,8 +948,11 @@ // Remove line and column from first line of error message only // if it is related to the tmp itself, i.e. only if the - // the error stack size is 0 or 1 - if (stack.size () < 2) + // the error stack size is 0, 1, or, if in debug mode, 2 + size_t max_stack_size = 1; + if (dbg) + max_stack_size = 2; + if (stack.size () <= max_stack_size) { QRegExp rx ("source: error sourcing file [^\n]*$"); if (new_msg.contains (rx)) @@ -984,9 +987,12 @@ } } - // Drop first stack level, i.e. temporary function file + // Drop first stack level, which is the temporary function file, + // or, if in debug mode, drop first two stack levels if (stack.size () > 0) stack.pop_back (); + if (dbg && (stack.size () > 0)) + stack.pop_back (); // Clean up before throwing the modified error. emit ctx_menu_run_finished_signal (show_dbg_file, err_line,