Commit Graph

5 Commits

Author SHA1 Message Date
Nikolai Kosjar
0bac3ad279 C++: Do not auto-insert '}' after control flow constructs
...as this rather gets in the way.

As before, pressing ENTER after { will still auto insert } on the next
line.

Fixes: QTCREATORBUG-18872
Change-Id: I8ee082962b5ee82781e51c3e5ee146343f808332
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2019-05-28 07:36:09 +00:00
Nikolai Kosjar
0629400288 C++: Do not auto-insert '}' after class/struct/enum/union
...when typing the opening brace. This restores the initial behavior
from version 4.3.

Not auto-inserting the closing brace allows the user to press Enter to
get "};" completed.

Change-Id: I8c62a08433a947e28f0555338a5fb8eeeae11bea
Task-number: QTCREATORBUG-18872
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-08 14:45:20 +00:00
Nikolai Kosjar
9092ef7992 C++: Do not insert matching } within string
Regression from

    commit a6aa287720
    C++: Fine-tune auto insertion of '}'

Change-Id: I3ede8c7a1e3c73708d5d5a59c314e4b4596976b2
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-08-07 13:01:30 +00:00
Nikolai Kosjar
a6aa287720 C++: Fine-tune auto insertion of '}'
Do not insert for these cases:
 * <Cursor>{
 * namespace X <Cursor>
 * if the next block is indented, like e.g.:
     if (e) <Cursor>
        g();
 * on empty line if text before looks like a finished statement or
   scope opening/end

Change-Id: Id9decc1e964a775724a929c2a3e79b5283105560
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-07-21 11:42:46 +00:00
Nikolai Kosjar
2c9feb1f4b C++: Add tests for MatchingText::contextAllowsAutoParentheses
Change-Id: I4c2bdf55112f473770db1515bd412215685bfe04
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-07-21 11:39:32 +00:00