From d76ef859c58051a29f8b5055a325b52ba435feb3 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Sat, 30 Mar 2024 10:56:18 +0800 Subject: [PATCH] fix: can't show info tips if the first line contains errors --- RedPandaIDE/editor.cpp | 1 + libs/qsynedit/qsynedit/qsynedit.cpp | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/RedPandaIDE/editor.cpp b/RedPandaIDE/editor.cpp index da6715e6..03d72748 100644 --- a/RedPandaIDE/editor.cpp +++ b/RedPandaIDE/editor.cpp @@ -2030,6 +2030,7 @@ void Editor::onTooltipTimer() } } + // Get subject bool isIncludeLine = false; bool isIncludeNextLine = false; diff --git a/libs/qsynedit/qsynedit/qsynedit.cpp b/libs/qsynedit/qsynedit/qsynedit.cpp index 032167d5..1926ba68 100644 --- a/libs/qsynedit/qsynedit/qsynedit.cpp +++ b/libs/qsynedit/qsynedit/qsynedit.cpp @@ -588,8 +588,7 @@ bool QSynEdit::pointToLine(const QPoint &point, int &line) || (point.y() > clientTop()+clientHeight())) { return false; } - line = rowToLine( - yposToRow(point.y() / mTextHeight)); + line = rowToLine(yposToRow(point.y())); return true; } @@ -718,8 +717,7 @@ BufferCoord QSynEdit::displayToBufferPos(const DisplayCoord &p) const if (p.row<1) return result; // Account for code folding - if (useCodeFolding()) - result.line = foldRowToLine(p.row); + result.line = rowToLine(p.row); // Account for tabs if (result.line <= mDocument->count() ) { result.ch = xposToGlyphStartChar(result.line,p.x);