forked from qt-creator/qt-creator
Merge remote branch 'origin/2.0'
Conflicts: README doc/qt-html-templates.qdocconf doc/qtcreator.qdoc doc/qtcreator.qdocconf src/app/Info.plist src/plugins/bineditor/BinEditor.pluginspec src/plugins/bookmarks/Bookmarks.pluginspec src/plugins/cmakeprojectmanager/CMakeProjectManager.pluginspec src/plugins/coreplugin/Core.pluginspec src/plugins/coreplugin/coreconstants.h src/plugins/cpaster/CodePaster.pluginspec src/plugins/cppeditor/CppEditor.pluginspec src/plugins/cpptools/CppTools.pluginspec src/plugins/cvs/CVS.pluginspec src/plugins/debugger/Debugger.pluginspec src/plugins/designer/Designer.pluginspec src/plugins/fakevim/FakeVim.pluginspec src/plugins/find/Find.pluginspec src/plugins/genericprojectmanager/GenericProjectManager.pluginspec src/plugins/git/ScmGit.pluginspec src/plugins/helloworld/HelloWorld.pluginspec src/plugins/help/Help.pluginspec src/plugins/locator/Locator.pluginspec src/plugins/mercurial/Mercurial.pluginspec src/plugins/perforce/Perforce.pluginspec src/plugins/projectexplorer/ProjectExplorer.pluginspec src/plugins/qmldesigner/QmlDesigner.pluginspec src/plugins/qmlinspector/QmlInspector.pluginspec src/plugins/qmljseditor/QmlJSEditor.pluginspec src/plugins/qmlprojectmanager/QmlProjectManager.pluginspec src/plugins/qt4projectmanager/Qt4ProjectManager.pluginspec src/plugins/regexp/RegExp.pluginspec src/plugins/resourceeditor/ResourceEditor.pluginspec src/plugins/snippets/Snippets.pluginspec src/plugins/subversion/Subversion.pluginspec src/plugins/texteditor/TextEditor.pluginspec src/plugins/vcsbase/VCSBase.pluginspec src/plugins/welcome/Welcome.pluginspec
This commit is contained in:
@@ -1190,7 +1190,6 @@ void BaseTextEditor::keyPressEvent(QKeyEvent *e)
|
||||
break;
|
||||
pos = cpos;
|
||||
}
|
||||
setTextCursor(textCursor()); // make cursor visible
|
||||
return;
|
||||
} else switch (e->key()) {
|
||||
|
||||
@@ -1234,7 +1233,6 @@ void BaseTextEditor::keyPressEvent(QKeyEvent *e)
|
||||
| Qt::MetaModifier)) == Qt::NoModifier
|
||||
&& !textCursor().hasSelection()) {
|
||||
handleBackspaceKey();
|
||||
setTextCursor(textCursor()); // make cursor visible
|
||||
e->accept();
|
||||
return;
|
||||
}
|
||||
@@ -3525,7 +3523,7 @@ void BaseTextEditor::extraAreaMouseEvent(QMouseEvent *e)
|
||||
toggleBlockVisible(c);
|
||||
d->moveCursorVisible(false);
|
||||
}
|
||||
} else if (e->pos().x() > markWidth) {
|
||||
} else if (d->m_lineNumbersVisible && e->pos().x() > markWidth) {
|
||||
QTextCursor selection = cursor;
|
||||
selection.setVisualNavigation(true);
|
||||
d->extraAreaSelectionAnchorBlockNumber = selection.blockNumber();
|
||||
@@ -3691,6 +3689,8 @@ void BaseTextEditor::handleHomeKey(bool anchor)
|
||||
setTextCursor(cursor);
|
||||
}
|
||||
|
||||
|
||||
#define SET_AND_RETURN(cursor) setTextCursor(cursor); return // make cursor visible and reset vertical x movement
|
||||
void BaseTextEditor::handleBackspaceKey()
|
||||
{
|
||||
QTextCursor cursor = textCursor();
|
||||
@@ -3710,7 +3710,7 @@ void BaseTextEditor::handleBackspaceKey()
|
||||
|
||||
if (!tabSettings.m_smartBackspace) {
|
||||
cursor.deletePreviousChar();
|
||||
return;
|
||||
SET_AND_RETURN(cursor);
|
||||
}
|
||||
|
||||
QTextBlock currentBlock = cursor.block();
|
||||
@@ -3718,7 +3718,7 @@ void BaseTextEditor::handleBackspaceKey()
|
||||
const QString blockText = currentBlock.text();
|
||||
if (cursor.atBlockStart() || tabSettings.firstNonSpace(blockText) < positionInBlock) {
|
||||
cursor.deletePreviousChar();
|
||||
return;
|
||||
SET_AND_RETURN(cursor);
|
||||
}
|
||||
|
||||
int previousIndent = 0;
|
||||
@@ -3737,10 +3737,11 @@ void BaseTextEditor::handleBackspaceKey()
|
||||
cursor.setPosition(currentBlock.position(), QTextCursor::KeepAnchor);
|
||||
cursor.insertText(tabSettings.indentationString(previousNonEmptyBlockText));
|
||||
cursor.endEditBlock();
|
||||
return;
|
||||
SET_AND_RETURN(cursor);
|
||||
}
|
||||
}
|
||||
cursor.deletePreviousChar();
|
||||
SET_AND_RETURN(cursor);
|
||||
}
|
||||
|
||||
void BaseTextEditor::wheelEvent(QWheelEvent *e)
|
||||
|
||||
Reference in New Issue
Block a user