forked from qt-creator/qt-creator
Fixed handling of text wrapping and a text layout corner case
Due to using QTextCursor::columnNumber() instead of QTextCursor::positionInBlock(), a lot of code would not work correctly when used with wrapped lines. In addition, there was an issue with columnNumber() returning 0 right after inserting a character before the last character of a line. Reviewed-by: mae
This commit is contained in:
@@ -1464,8 +1464,8 @@ void FakeVimHandler::Private::updateSelection()
|
||||
} else if (isVisualBlockMode()) {
|
||||
QTextCursor tc = m_tc;
|
||||
tc.setPosition(anchorPos);
|
||||
int anchorColumn = tc.columnNumber();
|
||||
int cursorColumn = m_tc.columnNumber();
|
||||
int anchorColumn = tc.positionInBlock();
|
||||
int cursorColumn = m_tc.positionInBlock();
|
||||
int anchorRow = tc.blockNumber();
|
||||
int cursorRow = m_tc.blockNumber();
|
||||
int startColumn = qMin(anchorColumn, cursorColumn);
|
||||
|
||||
Reference in New Issue
Block a user