Merge branch '0.9.1-beta' of git@scm.dev.nokia.troll.no:creator/mainline into 0.9.1-beta

This commit is contained in:
hjk
2008-12-05 18:30:00 +01:00
3 changed files with 25 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
<plugin name="CodePaster" version="0.1" compatVersion="0.1"> <plugin name="CodePaster" version="0.9.1" compatVersion="0.9.1">
<vendor>Nokia Corporation</vendor> <vendor>Nokia Corporation</vendor>
<copyright>(C) 2008 Nokia Corporation</copyright> <copyright>(C) 2008 Nokia Corporation</copyright>
<license>Nokia Technology Preview License Agreement</license> <license>Nokia Technology Preview License Agreement</license>

View File

@@ -1,4 +1,4 @@
<plugin name="ScmGit" version="0.1" compatVersion="0.1"> <plugin name="ScmGit" version="0.9.1" compatVersion="0.9.1">
<vendor>Nokia Corporation</vendor> <vendor>Nokia Corporation</vendor>
<copyright>(C) 2008 Nokia Corporation</copyright> <copyright>(C) 2008 Nokia Corporation</copyright>
<license>Nokia Technology Preview License Agreement</license> <license>Nokia Technology Preview License Agreement</license>

View File

@@ -602,29 +602,44 @@ void BaseTextEditor::slotSelectionChanged()
void BaseTextEditor::gotoBlockStart() void BaseTextEditor::gotoBlockStart()
{ {
QTextCursor cursor = textCursor(); QTextCursor cursor = textCursor();
if (TextBlockUserData::findPreviousOpenParenthesis(&cursor, false)) if (TextBlockUserData::findPreviousOpenParenthesis(&cursor, false)) {
setTextCursor(cursor); setTextCursor(cursor);
_q_matchParentheses();
}
} }
void BaseTextEditor::gotoBlockEnd() void BaseTextEditor::gotoBlockEnd()
{ {
QTextCursor cursor = textCursor(); QTextCursor cursor = textCursor();
if (TextBlockUserData::findNextClosingParenthesis(&cursor, false)) if (TextBlockUserData::findNextClosingParenthesis(&cursor, false)) {
setTextCursor(cursor); setTextCursor(cursor);
_q_matchParentheses();
}
} }
void BaseTextEditor::gotoBlockStartWithSelection() void BaseTextEditor::gotoBlockStartWithSelection()
{ {
QTextCursor cursor = textCursor(); QTextCursor cursor = textCursor();
if (TextBlockUserData::findPreviousOpenParenthesis(&cursor, true)) if (TextBlockUserData::findPreviousOpenParenthesis(&cursor, true)) {
setTextCursor(cursor); setTextCursor(cursor);
_q_matchParentheses();
}
} }
void BaseTextEditor::gotoBlockEndWithSelection() void BaseTextEditor::gotoBlockEndWithSelection()
{ {
QTextCursor cursor = textCursor(); QTextCursor cursor = textCursor();
if (TextBlockUserData::findNextClosingParenthesis(&cursor, true)) if (TextBlockUserData::findNextClosingParenthesis(&cursor, true)) {
setTextCursor(cursor); setTextCursor(cursor);
_q_matchParentheses();
}
}
static QTextCursor flippedCursor(const QTextCursor &cursor) {
QTextCursor flipped = cursor;
flipped.clearSelection();
flipped.setPosition(cursor.anchor(), QTextCursor::KeepAnchor);
return flipped;
} }
void BaseTextEditor::selectBlockUp() void BaseTextEditor::selectBlockUp()
@@ -640,7 +655,8 @@ void BaseTextEditor::selectBlockUp()
return; return;
if (!TextBlockUserData::findNextClosingParenthesis(&cursor, true)) if (!TextBlockUserData::findNextClosingParenthesis(&cursor, true))
return; return;
setTextCursor(cursor); setTextCursor(flippedCursor(cursor));
_q_matchParentheses();
} }
void BaseTextEditor::selectBlockDown() void BaseTextEditor::selectBlockDown()
@@ -663,7 +679,8 @@ void BaseTextEditor::selectBlockDown()
if ( cursor != d->m_selectBlockAnchor) if ( cursor != d->m_selectBlockAnchor)
TextBlockUserData::findNextClosingParenthesis(&cursor, true); TextBlockUserData::findNextClosingParenthesis(&cursor, true);
setTextCursor(cursor); setTextCursor(flippedCursor(cursor));
_q_matchParentheses();
} }