[education/rkward] rkward/windows: Do not show function argument completion when obviously inappropriate

Thomas Friedrichsmeier null at kde.org
Mon Mar 21 17:26:15 GMT 2022


Git commit 8441b8ee7e240e93a47b85d4a8624334fa8ebfae by Thomas Friedrichsmeier.
Committed on 21/03/2022 at 17:26.
Pushed by tfry into branch 'master'.

Do not show function argument completion when obviously inappropriate

M  +4    -2    rkward/windows/rkcodecompletion.cpp

https://invent.kde.org/education/rkward/commit/8441b8ee7e240e93a47b85d4a8624334fa8ebfae

diff --git a/rkward/windows/rkcodecompletion.cpp b/rkward/windows/rkcodecompletion.cpp
index 91c3ba90..8a31a42a 100644
--- a/rkward/windows/rkcodecompletion.cpp
+++ b/rkward/windows/rkcodecompletion.cpp
@@ -742,8 +742,10 @@ void RKArgumentHintModel::updateCompletionList (RObject* _function, const QStrin
 		}
 		fragment = argument;
 		matches.clear ();
-		for (int i = 0; i < args.size (); ++i) {
-			if (args[i].startsWith (fragment)) matches.append (i);
+		if (!fragment.isNull()) {  // meaning were not on an argument name for sure
+			for (int i = 0; i < args.size (); ++i) {
+				if (args[i].startsWith (fragment)) matches.append (i);
+			}
 		}
 	}
 


More information about the rkward-tracker mailing list