forked from qt-creator/qt-creator
Editor: Blockselection rewrite.
Also adding the possibility to insert text into the blockselection. Task-number: QTCREATORBUG-7773 Change-Id: I7a47a1d630f769a8253ee1a2f21057820ea170d5 Reviewed-by: Lukas Holecek <hluk@email.cz> Reviewed-by: Christian Stenger <christian.stenger@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -213,6 +213,18 @@ int TabSettings::positionAtColumn(const QString &text, int column, int *offset)
|
||||
return i;
|
||||
}
|
||||
|
||||
int TabSettings::columnCountForText(const QString &text, int startColumn) const
|
||||
{
|
||||
int column = startColumn;
|
||||
for (int i = 0; i < text.size(); ++i) {
|
||||
if (text.at(i) == QLatin1Char('\t'))
|
||||
column = column - (column % m_tabSize) + m_tabSize;
|
||||
else
|
||||
++column;
|
||||
}
|
||||
return column - startColumn;
|
||||
}
|
||||
|
||||
int TabSettings::spacesLeftFromPosition(const QString &text, int position)
|
||||
{
|
||||
int i = position;
|
||||
|
||||
Reference in New Issue
Block a user