[education/rkward] rkward: Formatting

Thomas Friedrichsmeier null at kde.org
Mon May 26 15:06:38 BST 2025


Git commit b76dde00222205c728a3049749762f3649d54880 by Thomas Friedrichsmeier.
Committed on 26/05/2025 at 14:06.
Pushed by tfry into branch 'master'.

Formatting

M  +12   -12   rkward/pages/rkward_code_navigation.rkh
M  +7    -6    rkward/windows/rkcommandeditorwindow.cpp

https://invent.kde.org/education/rkward/-/commit/b76dde00222205c728a3049749762f3649d54880

diff --git a/rkward/pages/rkward_code_navigation.rkh b/rkward/pages/rkward_code_navigation.rkh
index 5d7ffa4ae..8c624a249 100644
--- a/rkward/pages/rkward_code_navigation.rkh
+++ b/rkward/pages/rkward_code_navigation.rkh
@@ -16,23 +16,23 @@ statement outside the current scope or to the previous top level statement. Seve
 To bring up the code naviagtion mode in script (R or R markdown) window, press the key combination "Meta+n" (shortcut customizable), or select it from the <i>Run</i>-menu. Subsequent single key presses invoke the following actions:
 
 <ul>
-	<li><b>n / N</b> Go to the next (n) or previous (N) statement at the current level, or the next outer level</li>
-	<li><b>i / I</b> Like n/N, but also step into inner contexts (such as the definition of a function)</li>
-	<li><b>o / O</b> Jump directly to the next / previous statement outside the current level (e.g. the first statement after a function body)</li>
-	<li><b>t / T</b> Go to the next / previous statement at the topmost level of the script</li>
-	<li><b>c / C</b> (For R Markdown documents, only:) Go to the next / previous code chunk</li>
-	<li><b>1 / !</b> Go to the top / bottom of the document</li>
-	<li><b>s</b> Select the current statement</li>
-	<li><b>S</b> (For R Markdown documents, only:) Select add code in the current chunk</li>
-	<li><b>Backspace</b> Go back to the position before the latest action.</li>
-	<li><b>Esc</b> Exit code navigation mode, and reset the cursor / selection to the state before entering it.</li>
-	<li><b>Return</b> Exit code navigation mode, keeping current position/selection.</li>
+	<li><tt><b>n / N</b></tt> Go to the next (n) or previous (N) statement at the current level, or the next outer level</li>
+	<li><tt><b>i / I</b></tt> Like n/N, but also step into inner contexts (such as the definition of a function)</li>
+	<li><tt><b>o / O</b></tt> Jump directly to the next / previous statement outside the current level (e.g. the first statement after a function body)</li>
+	<li><tt><b>t / T</b></tt> Go to the next / previous statement at the topmost level of the script</li>
+	<li><tt><b>c / C</b></tt> (For R Markdown documents, only:) Go to the next / previous code chunk</li>
+	<li><tt><b>1 / !</b></tt> Go to the top / bottom of the document</li>
+	<li><tt><b>s</b></tt> Select the current statement</li>
+	<li><tt><b>S</b></tt> (For R Markdown documents, only:) Select add code in the current chunk</li>
+	<li><tt><b>Backspace</b></tt> Go back to the position before the latest action.</li>
+	<li><tt><b>Esc</b></tt> Exit code navigation mode, and reset the cursor / selection to the state before entering it.</li>
+	<li><tt><b>Return</b></tt> Exit code navigation mode, keeping current position/selection.</li>
 	<li>Code navigation will also end, if you click anywhere else in the script, switch to a different window, or the script is modified.</li>
 </ul>
 
 Finally, you can continue to use regular shortcuts, while in code navigation mode. This includes, importantly:
 <ul>
-	<li><b>Ctrl+Return</b> Run the current line or selection.</li>
+	<li><tt><b>Ctrl+Return</b></tt> Run the current line or selection.</li>
 </ul>
 	</section>
 
diff --git a/rkward/windows/rkcommandeditorwindow.cpp b/rkward/windows/rkcommandeditorwindow.cpp
index 6b8be0793..e4a8e7e3c 100644
--- a/rkward/windows/rkcommandeditorwindow.cpp
+++ b/rkward/windows/rkcommandeditorwindow.cpp
@@ -89,6 +89,7 @@ class RKCodeNavigation : public QFrame {
 		box->addWidget(input);
 
 		message = new QLabel();
+		message->setTextFormat(Qt::RichText);
 		message->hide();
 		box->addWidget(message);
 
@@ -213,7 +214,7 @@ class RKCodeNavigation : public QFrame {
 			newpos.selection = KTextEditor::Range(positionToCursor(posa), positionToCursor(posb + 1));
 		} else {
 			RK_DEBUG(COMMANDEDITOR, DL_WARNING, "unknown navigation commmand");
-			message->setText(i18n("Unknown command '%1'").arg(command));
+			message->setText(i18n("Unknown command <tt><b>%1</b></tt>").arg(command));
 			message->show();
 			updatePos();
 			return;
@@ -222,15 +223,15 @@ class RKCodeNavigation : public QFrame {
 		if (newpos.pos < 0 && command.toLower() != u's') {
 			if (rmdmode && newpos.command.toLower() != u'c') {
 				if (command.toLower() == command) {
-					message->setText(i18nc("Keep this short", "Search hit bottom.\n'c' to move to next chunk."));
+					message->setText(i18nc("Keep this short", "Search hit bottom.<br/><tt><b>c</b></tt> to move to next chunk."));
 				} else {
-					message->setText(i18nc("Keep this short", "Search hit top.\n'C' to move to previous chunk."));
+					message->setText(i18nc("Keep this short", "Search hit top.<br/><tt><b>C</b></tt> to move to previous chunk."));
 				}
 			} else {
 				if (command.toLower() == command) {
-					message->setText(i18nc("Keep this short", "Search hit bottom.\n'1' to move to top."));
+					message->setText(i18nc("Keep this short", "Search hit bottom.<br/><tt><b>1</b></tt> to move to top."));
 				} else {
-					message->setText(i18nc("Keep this short", "Search hit top.\n'!' to move to bottom."));
+					message->setText(i18nc("Keep this short", "Search hit top.<br/><tt><b>!</b></tt> to move to bottom."));
 				}
 			}
 			message->show();
@@ -279,7 +280,7 @@ class RKCodeNavigation : public QFrame {
 		}
 	}
 
-	void paintEvent(QPaintEvent *e) {
+	void paintEvent(QPaintEvent *e) override {
 		QFrame::paintEvent(e);
 
 		QPainter paint(this);



More information about the rkward-tracker mailing list