forked from qt-creator/qt-creator
Lua: Add font getter method to TextDocument lua type
Change-Id: I60da4f51f2ddc7b930b827f721818210610ea115 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -353,6 +353,11 @@ void setupTextEditorModule()
|
||||
QTC_ASSERT(document, throw sol::error("TextDocument is not valid"));
|
||||
return document->filePath();
|
||||
},
|
||||
"font",
|
||||
[](const TextDocumentPtr &document) {
|
||||
QTC_ASSERT(document, throw sol::error("TextDocument is not valid"));
|
||||
return document->fontSettings().font();
|
||||
},
|
||||
"blockAndColumn",
|
||||
[](const TextDocumentPtr &document, int position) -> std::optional<std::pair<int, int>> {
|
||||
QTC_ASSERT(document, throw sol::error("TextDocument is not valid"));
|
||||
|
@@ -78,6 +78,10 @@ local TextDocument = {}
|
||||
---@return FilePath filePath The file path of the document.
|
||||
function TextDocument:file() end
|
||||
|
||||
---Returns the font of the document.
|
||||
---@return QFont
|
||||
function TextDocument:font() end
|
||||
|
||||
---Returns the block (line) and column for the given position.
|
||||
---@param position integer The position to convert.
|
||||
---@return integer block The block (line) of the position.
|
||||
|
Reference in New Issue
Block a user