changeset 28276:dd5ab20e547a

maint: merge stable to default.
author John W. Eaton <jwe@octave.org>
date Fri, 08 May 2020 22:23:03 -0400
parents 74af52e0e0fa (current diff) efa916abcbdd (diff)
children 01358faf49c9
files
diffstat 2 files changed, 27 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/languages/pt_BR.ts	Fri May 08 00:57:48 2020 -0400
+++ b/libgui/languages/pt_BR.ts	Fri May 08 22:23:03 2020 -0400
@@ -926,7 +926,7 @@
     <message>
         <location line="+9"/>
         <source>&amp;Run</source>
-        <translation>&amp;Executar</translation>
+        <translation type="unfinished">E&amp;xecutar</translation>
     </message>
     <message>
         <location line="-1988"/>
@@ -951,7 +951,7 @@
     <message>
         <location line="+6"/>
         <source>&amp;Help</source>
-        <translation>&amp;Ajuda</translation>
+        <translation type="unfinished">Aj&amp;uda</translation>
     </message>
     <message>
         <location line="+4"/>
@@ -2221,7 +2221,7 @@
     <message>
         <location line="+5"/>
         <source>&amp;Help</source>
-        <translation>&amp;Ajuda</translation>
+        <translation type="unfinished">Aj&amp;uda</translation>
     </message>
     <message>
         <location line="+7"/>
--- a/libgui/src/m-editor/octave-qscintilla.cc	Fri May 08 00:57:48 2020 -0400
+++ b/libgui/src/m-editor/octave-qscintilla.cc	Fri May 08 22:23:03 2020 -0400
@@ -852,10 +852,14 @@
     // Split contents into single lines and complete commands
     QStringList lines = selectedText ().split (QRegExp ("[\r\n]"),
                                                QString::SkipEmptyParts);
+    QString line_code_tmp;
+    bool is_contd_line;
+    QRegExp contd_line ("\\.\\.\\.\\s*$");
 
     for (int i = 0; i < lines.count (); i++)
       {
         QString line = lines.at (i);
+        is_contd_line = line.contains (contd_line);
         QString line_escaped = line;
         line_escaped.replace (QString ("'"), QString ("''"));
         QString line_history = line;
@@ -875,6 +879,20 @@
             next_bp_quiet_reset = "__db_next_breakpoint_quiet__(false);\n";
           }
 
+        // Handle continued lines
+        line_code_tmp = line_code_tmp + line;
+        QString line_code;
+        if (is_contd_line)
+          {
+            line_code_tmp = line_code_tmp + "\n"; // Next line will be added
+            line_code = "";                       // No code by now
+          }
+        else
+          {
+            line_code = line_code_tmp + "\n";     // Code is ready
+            line_code_tmp = "";                   // No code to be cont'd
+          }
+
         // Add codeline together with call to echo/history function to tmp
         // %1 : function name for displaying and adding to history
         // %2 : line number
@@ -883,14 +901,14 @@
         // %5 : command line (eval)
         code += QString ("%1 (%2, '%3', '%4');\n"
                          + next_bp_quiet
-                         + "%5\n"
+                         + line_code
                          + next_bp_quiet_reset
                          + "\n")
                 .arg (tmp_script_name)
                 .arg (i)
                 .arg (line_escaped)
-                .arg (line_history)
-                .arg (line);
+                .arg (line_history);
+
       }
 
     code += QString ("munlock (\"%1\"); clear %1;\n").arg (tmp_script_name);
@@ -995,9 +1013,9 @@
     resource_manager& rmgr = m_octave_qobj.get_resource_manager ();
     gui_settings *settings = rmgr.get_settings ();
     settings->setValue (ed_show_dbg_file.key, show_dbg_file);
-    rmgr.remove_tmp_file (tmp_file);
-    rmgr.remove_tmp_file (tmp_hist);
-    rmgr.remove_tmp_file (tmp_script);
+    //rmgr.remove_tmp_file (tmp_file);
+    //rmgr.remove_tmp_file (tmp_hist);
+    //rmgr.remove_tmp_file (tmp_script);
   }