[education/rkward] /: Fix showing multi-line expressions in R Console preview

Thomas Friedrichsmeier null at kde.org
Fri Jun 17 12:12:28 BST 2022


Git commit 2195f4f45244f5dbe535db161c206c190df266a4 by Thomas Friedrichsmeier.
Committed on 17/06/2022 at 11:12.
Pushed by tfry into branch 'master'.

Fix showing multi-line expressions in R Console preview

M  +1    -0    ChangeLog
M  +1    -1    rkward/rbackend/rkrinterface.cpp

https://invent.kde.org/education/rkward/commit/2195f4f45244f5dbe535db161c206c190df266a4

diff --git a/ChangeLog b/ChangeLog
index 1df0f524..0863a552 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+- Fixed: Expresssions spanning several lines would not be shown, correctly, in "R Console"-mode script preview
 - Fix focus problems, and better efficiency for data previews (as used in data import dialogs)
 - Fixed: Excel import plugin failed to accept file name
 - Add option to offer code completion/hinting in all file types not just R scripts (e.g. in .Rmd files)
diff --git a/rkward/rbackend/rkrinterface.cpp b/rkward/rbackend/rkrinterface.cpp
index 22d5cb9a..7f63ca5b 100644
--- a/rkward/rbackend/rkrinterface.cpp
+++ b/rkward/rbackend/rkrinterface.cpp
@@ -568,7 +568,7 @@ GenericRRequestResult RInterface::processPlainGenericRequest(const QStringList &
 		QDir::setCurrent (calllist.value (1));
 		emit backendWorkdirChanged();
 	} else if (call == "highlightRCode") {
-		return GenericRRequestResult(RKCommandHighlighter::commandToHTML(calllist.value(1)));
+		return GenericRRequestResult(RKCommandHighlighter::commandToHTML(calllist.mid(1).join('\n')));
 	} else if (call == "quit") {
 		RKWardMainWindow::getMain ()->close ();
 		// if we're still alive, quitting was canceled


More information about the rkward-tracker mailing list