forked from qt-creator/qt-creator
Lua: Add TextCursor:selectedText binding
Change-Id: I7613b5c6d03dcdd94ec553bcf17f532fe6b650c7 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -176,7 +176,11 @@ void setupTextEditorModule()
|
||||
"columnNumber",
|
||||
&QTextCursor::columnNumber,
|
||||
"hasSelection",
|
||||
&QTextCursor::hasSelection);
|
||||
&QTextCursor::hasSelection,
|
||||
"selectedText",
|
||||
[](QTextCursor *cursor) {
|
||||
return cursor->selectedText().replace(QChar::ParagraphSeparator, '\n');
|
||||
});
|
||||
|
||||
result.new_usertype<TextEditor::BaseTextEditor>(
|
||||
"TextEditor",
|
||||
|
@@ -6,6 +6,9 @@ local textEditor = {}
|
||||
---@field blockNumber integer The block (line) number of the cursor.
|
||||
---@field columnNumber integer The column number of the cursor.
|
||||
local TextCursor = {}
|
||||
---Returns the selected text of the cursor.
|
||||
---@return string selectedText The selected text of the cursor.
|
||||
function TextCursor:selectedText() end
|
||||
|
||||
---@class MultiTextCursor
|
||||
---@field mainCursor TextCursor The main cursor.
|
||||
|
Reference in New Issue
Block a user