Mercurial > octave
changeset 28108:8e8a6e6ddf9c
maint: merge stable to default.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 19 Feb 2020 10:11:19 -0500 |
parents | d320728d5d06 (current diff) b0f949055097 (diff) |
children | 42892c93bd25 |
files | |
diffstat | 1 files changed, 11 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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);