From 63f2477542df5c3ce53dfc9ee3881ed7740a42f7 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Mon, 16 Sep 2024 09:48:49 +0200 Subject: [PATCH] Lua: Let MultiTextCusor::cursors return a table There is a problem with sorting QList due to the implicit sharing in QTextCursor. For now just convert the list to a table which works with table.sort as well. Change-Id: Ia9bb8c7b89b5cd19f7f111eeaa6fc3ea381774ea Reviewed-by: David Schulz --- src/plugins/lua/bindings/texteditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/lua/bindings/texteditor.cpp b/src/plugins/lua/bindings/texteditor.cpp index 9d6cac00025..af716a32326 100644 --- a/src/plugins/lua/bindings/texteditor.cpp +++ b/src/plugins/lua/bindings/texteditor.cpp @@ -164,7 +164,7 @@ void setupTextEditorModule() "mainCursor", &MultiTextCursor::mainCursor, "cursors", - &MultiTextCursor::cursors); + [](MultiTextCursor *self) { return sol::as_table(self->cursors()); }); result.new_usertype( "TextCursor",