tune auto-indentation of pasted text

auto-indentation of pasted text now only happens when complete
lines including a trailing paragraph separator are copied and pasted.

In addition, the reindent() functions ensures that the relative indentation
within the pasted block is preserved. This mechanism is now also used for
moving lines up/down.

Done with thorbjorn
This commit is contained in:
mae
2009-09-29 12:44:00 +02:00
parent b1f5a40ee2
commit 0ed9043c34
4 changed files with 116 additions and 22 deletions

View File

@@ -521,6 +521,8 @@ protected:
virtual void indentBlock(QTextDocument *doc, QTextBlock block, QChar typedChar);
// Indent at cursor. Calls indentBlock for selection or current line.
virtual void indent(QTextDocument *doc, const QTextCursor &cursor, QChar typedChar);
// Reindent at cursor. Selection will be adjusted according to the indentation change of the first block
virtual void reindent(QTextDocument *doc, const QTextCursor &cursor);
struct Link
{