# HG changeset patch # User John W. Eaton # Date 1582125079 18000 # Node ID 8e8a6e6ddf9c8b55f1dcab1cb1366a522c072e04 # Parent d320728d5d06eacbf7ad000d765d9b56ce6b1b41# Parent b0f94905509717e8677475ef9236b83f76f0524e maint: merge stable to default. diff -r d320728d5d06 -r 8e8a6e6ddf9c libgui/src/m-editor/octave-qscintilla.cc --- a/libgui/src/m-editor/octave-qscintilla.cc Wed Feb 19 10:09:18 2020 -0500 +++ b/libgui/src/m-editor/octave-qscintilla.cc Wed Feb 19 10:11:19 2020 -0500 @@ -856,10 +856,13 @@ for (int i = 0; i < lines.count (); i++) { QString line = lines.at (i); + QString line_escaped = line; + line_escaped.replace (QString ("'"), QString ("''")); QString line_history = line; line_history.replace (QString ("\\"), QString ("\\\\")); line_history.replace (QString ("\""), QString ("\\\"")); line_history.replace (QString ("%"), QString ("%%")); + line_history.replace (QString ("'"), QString ("''")); // Prevent output of breakpoint in temp. file for keyboard QString next_bp_quiet; @@ -867,25 +870,27 @@ if (line.contains ("keyboard")) { // Define commands for not showing bp location and for resetting - // thisin case "keyboard" was within a comment + // this in case "keyboard" was within a comment next_bp_quiet = "__db_next_breakpoint_quiet__;\n"; next_bp_quiet_reset = "__db_next_breakpoint_quiet__(false);\n"; } - // Add codeline togetcher with call to echo/hitory function to tmp + // Add codeline together with call to echo/history function to tmp // %1 : function name for displaying and adding to history // %2 : line number - // %3 : command line (eval and display) + // %3 : command line with escaped single quotes (display) // %4 : command line for history (via fprintf) + // %5 : command line (eval) code += QString ("%1 (%2, '%3', '%4');\n" + next_bp_quiet - + "%3\n" + + "%5\n" + next_bp_quiet_reset + "\n") .arg (tmp_script_name) .arg (i) - .arg (line) - .arg (line_history); + .arg (line_escaped) + .arg (line_history) + .arg (line); } code += QString ("munlock (\"%1\"); clear %1;\n").arg (tmp_script_name);