Skip to content
Snippets Groups Projects
Commit 5c6cfdf8 authored by mae's avatar mae
Browse files

Fixed find scope

There was an off-by-one error for the normal find scope.
Improved look by ignoring the left side.
parent 1bed93e0
No related branches found
No related tags found
No related merge requests found
......@@ -329,7 +329,7 @@ void BaseTextFind::defineFindScope()
{
QTextCursor cursor = textCursor();
if (cursor.hasSelection() && cursor.block() != cursor.document()->findBlock(cursor.anchor())) {
d->m_findScopeStart = QTextCursor(document()->docHandle(), qMax(0, cursor.selectionStart()-1));
d->m_findScopeStart = QTextCursor(document()->docHandle(), qMax(0, cursor.selectionStart()));
d->m_findScopeEnd = QTextCursor(document()->docHandle(), cursor.selectionEnd());
d->m_findScopeVerticalBlockSelectionFirstColumn = -1;
d->m_findScopeVerticalBlockSelectionLastColumn = -1;
......@@ -344,7 +344,7 @@ void BaseTextFind::defineFindScope()
emit findScopeChanged(d->m_findScopeStart, d->m_findScopeEnd,
d->m_findScopeVerticalBlockSelectionFirstColumn,
d->m_findScopeVerticalBlockSelectionLastColumn);
cursor.setPosition(d->m_findScopeStart.position()+1);
cursor.setPosition(d->m_findScopeStart.position());
setTextCursor(cursor);
} else {
clearFindScope();
......
......@@ -171,10 +171,10 @@ QPainterPath TextEditorOverlay::createSelectionPath(const QTextCursor &begin, co
inSelection = true;
firstOrLastBlock = true;
} else {
while (beginChar < block.length() && document->characterAt(block.position() + beginChar).isSpace())
++beginChar;
if (beginChar == block.length())
beginChar = 0;
// while (beginChar < block.length() && document->characterAt(block.position() + beginChar).isSpace())
// ++beginChar;
// if (beginChar == block.length())
// beginChar = 0;
}
int lastLine = blockLayout->lineCount()-1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment