Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package rkward for openSUSE:Factory checked 
in at 2024-01-23 22:57:28
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rkward (Old)
 and      /work/SRC/openSUSE:Factory/.rkward.new.16006 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rkward"

Tue Jan 23 22:57:28 2024 rev:32 rq:1141006 version:0.7.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/rkward/rkward.changes    2022-11-08 
10:56:17.757959208 +0100
+++ /work/SRC/openSUSE:Factory/.rkward.new.16006/rkward.changes 2024-01-23 
22:57:38.671706453 +0100
@@ -1,0 +2,18 @@
+Fri Jan  5 10:51:40 UTC 2024 - Dominique Leuenberger <dims...@opensuse.org>
+
+- Add extra-cmake-module BuildRequires: This used to be dragged in
+  by other deps before, but cmake explicitly checks for it here.
+
+-------------------------------------------------------------------
+Wed Dec 28 19:35:26 UTC 2022 - Pierre Bonamy <fl...@mailoo.org>
+
+- Add Fix_Syntax_Pipe.patch: Backport fix to properly highlight
+  the native pipe "|>" as an operator in the R console.
+
+-------------------------------------------------------------------
+Tue Dec 27 12:28:17 UTC 2022 - Pierre Bonamy <fl...@mailoo.org>
+
+- Backport fix to display progress bars from 'cli' package in
+  RKWard R console. See "Fix_handling_carriage_returns.patch".
+
+-------------------------------------------------------------------

New:
----
  Fix_Syntax_Pipe.patch
  Fix_handling_carriage_returns.patch

BETA DEBUG BEGIN:
  New:
- Add Fix_Syntax_Pipe.patch: Backport fix to properly highlight
  the native pipe "|>" as an operator in the R console.
  New:- Backport fix to display progress bars from 'cli' package in
  RKWard R console. See "Fix_handling_carriage_returns.patch".
BETA DEBUG END:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rkward.spec ++++++
--- /var/tmp/diff_new_pack.KUgsOF/_old  2024-01-23 22:57:39.131723273 +0100
+++ /var/tmp/diff_new_pack.KUgsOF/_new  2024-01-23 22:57:39.135723419 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package rkward
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2024 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -36,8 +36,11 @@
 Group:          Productivity/Scientific/Math
 URL:            https://rkward.kde.org/
 Source0:        
https://download.kde.org/stable/%{name}/%{version}/src/%{name}-%{version}.tar.gz
+Patch0:         Fix_handling_carriage_returns.patch
+Patch1:         Fix_Syntax_Pipe.patch
 BuildRequires:  R-base-devel
 BuildRequires:  cmake
+BuildRequires:  extra-cmake-modules
 BuildRequires:  gcc-fortran
 BuildRequires:  gettext
 BuildRequires:  karchive-devel
@@ -87,6 +90,8 @@
 
 %prep
 %setup -q
+%patch0 -p1
+%patch1 -p1
 
 %build
 %cmake_kf5 -d build

++++++ Fix_Syntax_Pipe.patch ++++++
--- "a/rkward/syntax/rkward.xml"        2022-05-18 22:08:39.000000000 +0200
+++ "b/rkward/syntax/rkward.xml"        2022-12-28 19:09:40.155240669 +0100
@@ -140,7 +140,7 @@
                        <RegExpr attribute="Assign" context="operator_rhs" 
String="[&lt;]{1,2}\-"/>
                        <RegExpr attribute="Assign" context="operator_rhs" 
String="\-[&gt;]{1,2}"/>
                        <RegExpr attribute="Assign" context="operator_rhs" 
String="=(?!=)"/>
-                       <RegExpr attribute="Operator" context="operator_rhs" 
String="(\+|\-|\*{1,2}|/|&lt;=?|&gt;=?|={1,2}|\!=?|\|{1,2}|&amp;{1,2}|:{1,3}|\^|@|\$|~)"/>
+                       <RegExpr attribute="Operator" context="operator_rhs" 
String="(\+|\-|\*{1,2}|/|&lt;=?|&gt;=?|={1,2}|\!=?|\|[&gt;\|]?|&amp;{1,2}|:{1,3}|\^|@|\$|~)"/>
                        <RegExpr attribute="Operator" context="operator_rhs" 
String="%[^%]*%"/>
 
                        <!-- Contrary to the normal R Script highlighting, we 
don't start a region here, but we do go into a command sub-context -->

++++++ Fix_handling_carriage_returns.patch ++++++
--- "a/rkward/rkconsole.cpp"    2022-06-25 09:26:29.000000000 +0200
+++ "b/rkward/rkconsole.cpp"    2022-12-26 03:12:50.000000000 +0100
@@ -486,6 +486,7 @@
        skip_command_display_lines = incomplete_command.count ('\n') + 1;       
// incomplete command, and first line have already been shown.
 
        doc->insertLine (doc->lines (), QString ());
+       output_cursor = doc->documentEnd();
        if (!command.isEmpty ()) {
                current_command = new RCommand (command, RCommand::User | 
RCommand::Console);
                connect(current_command->notifier(), 
&RCommandNotifier::commandOutput, this, &RKConsole::newOutput);
@@ -533,11 +534,30 @@
        else qApp->beep ();
 }
 
+void RKConsole::rawWriteLine(const QString& line, QChar line_end) {
+       int existing_line_length = doc->lineLength(output_cursor.line());
+       if (output_cursor.column() < existing_line_length) {
+               int overwrite_end = qMin(existing_line_length, 
output_cursor.column() + line.length());
+               doc->removeText(KTextEditor::Range(output_cursor, 
KTextEditor::Cursor(output_cursor.line(), overwrite_end)));
+       }
+       doc->insertText(output_cursor, line);
+       output_cursor.setColumn(output_cursor.column() + line.length());
+       if (line_end == '\n') {
+               output_cursor.setColumn(doc->lineLength(output_cursor.line()));
+               doc->insertText(output_cursor, "\n");
+               output_cursor.setColumn(0);
+               output_cursor.setLine(output_cursor.line() + 1);
+       } else if (line_end == '\r') {
+               output_cursor.setColumn(0);
+       }
+}
+
 void RKConsole::newOutput (RCommand *command, const ROutput *output) {
        RK_TRACE (APP);
 
        int first_line = doc->lines () -1;
        QString popped_line;
+       // TODO: rewrite utilizing output_cursor;
        if (!command) {
                // spontanteous R output, to be inserted _above_ the current 
command
                // as a shortcut, we pop the last line, and reinsert in, later
@@ -545,25 +565,19 @@
                doc->removeLine(doc->lines() - 1);
        }
 
-       // split by and handle carriage returns
-       const QString outstr = output->output;
+       // split by and handle carriage returns (important for progress bars)
+       const QString out = output->output;
+       int string_pos = -1;
        int start_pos = 0;
-       int end_pos = outstr.size () - 1;
-       QChar c;
-       for (int pos = 0; pos <= end_pos; ++pos) {
-               c = output->output.at (pos);
-               if (c == '\r') {
-                       /* NOTE: My first approach was to split the whole 
string by newlines, and insert each line separately. This allowed for a minor
-                        * optimization when hitting a carriage return (the 
string before the '\r' could simply be ignored, then), however it caused
-                        * around 10% slowdown when printing large amounts of 
output.
-                        * Thus, instead, when hitting a CR, we first insert 
everything before that into the document, then reset the line. */
-                       doc->insertText (doc->documentEnd (), outstr.mid 
(start_pos, pos - start_pos));
-                       doc->removeLine (doc->lines () - 1);
-                       doc->insertLine (doc->lines (), QString ());
-                       start_pos = pos + 1;
+       int end_pos = out.length();
+       while (++string_pos < end_pos) {
+               auto c = out.at(string_pos);
+               if (c == '\n' || c == '\r') {
+                       rawWriteLine(out.mid(start_pos, string_pos - 
start_pos), c);
+                       start_pos = string_pos+1;
                }
        }
-       if (start_pos <= end_pos) doc->insertText (doc->documentEnd (), 
outstr.mid (start_pos, end_pos - start_pos + 1));
+       if (start_pos < end_pos) rawWriteLine(out.mid(start_pos, string_pos - 
start_pos + 1), ' ');
 
        int end_line = doc->lines () -1;
        if (output->type != ROutput::Output || (!command)) {
@@ -581,6 +595,7 @@
 // KDE4: does the setUpdatesEnabled (false) still affect performance?
                        view->setUpdatesEnabled (false);                // 
major performance boost while removing lines!
                        doc->removeText (KTextEditor::Range (0, 0, c - 
RKSettingsModuleConsole::maxConsoleLines (), 0));
+                       output_cursor.setLine(output_cursor.line() - c + 
RKSettingsModuleConsole::maxConsoleLines());
                        view->setUpdatesEnabled (true);
                }
        }
@@ -606,6 +621,7 @@
        prefix = iprefix;
        showPrompt ();
        setCurrentEditingLine (line);
+       output_cursor = doc->documentEnd();
 }
 
 void RKConsole::submitBatch (const QString &batch) {

--- "a/rkward/rkconsole.h"      2022-06-09 16:30:25.000000000 +0200
+++ "b/rkward/rkconsole.h"      2022-12-26 03:12:50.000000000 +0100
@@ -169,6 +169,8 @@
        int current_command_displayed_up_to;
        int skip_command_display_lines;
        bool previous_chunk_was_piped;
+       KTextEditor::Cursor output_cursor;
+       void rawWriteLine(const QString &line, QChar line_end);
 };
 
 /** A part interface to RKConsole. Provides the context-help functionality

Reply via email to