C++: support smart splitting of strings.

If 'enter' is pressed while the cursor is in the middle of a string,
the string is ended at the current cursor position, and a new string
is started on the next line.  This makes it very easy to split a long
string onto multiple lines.

In addition, Shift+Enter insert an escape in the string, to continue the
string at the beginning of next line.

A setting can be used to enable or disable this option.

Change-Id: Ia5f3c6989fc00d40d06bc4fe1182fe8b1318f565
Reviewed-by: Francois Ferrand <thetypz@gmail.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
Francois Ferrand
2014-09-29 18:19:38 +02:00
committed by hjk
parent 82d9cf4146
commit 32b960db47
10 changed files with 162 additions and 63 deletions

View File

@@ -332,6 +332,12 @@ bool AutoCompleter::isInComment(const QTextCursor &cursor) const
return false;
}
bool AutoCompleter::isInString(const QTextCursor &cursor) const
{
Q_UNUSED(cursor);
return false;
}
QString AutoCompleter::insertMatchingBrace(const QTextCursor &cursor,
const QString &text,
QChar la,