<table><tr><td style="">cactus added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D4234" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>Hello,</p>

<p>In the case of void foo(bar); the both solution has the same result. But when you have 2 levels of bracket the result are different.<br />
In the example of :<br />
if (isEndMatching())<br />
or <br />
printf("Bonjour")</p>

<p>With auto-brackets enabled and with the old behavior, if you type every char you obtain :<br />
if (isEndMatching()))<br />
and<br />
printf("Bonjour"))</p>

<p>To have 2 levels of bracket is very common.<br />
For example, in the diff below you have :<br />
if (view->config()->autoBrackets() && chars.size() == 1) {<br />
closingBracket = matchingEndBracket(chars[0], true);<br />
if ( m_currentAutobraceClosingChar == chars[0] && m_currentAutobraceRange ) {<br />
if (!closingBracket.isNull() && !skipAutobrace ) {<br />
 if (!(config()->backspaceIndents())) {<br />
const auto nextChar = view->document()->text({cursorPos, cursorPos + Cursor{0, 1}}).trimmed();<br />
uint col = qMax(c.column(), 0);<br />
removeText(KTextEditor::Range(line - 1, textLine->length(), line, 0));</p>

<p>I think more than 1/2 of this below code use more than 1 level of bracket and the current code isn't enough smart to eat them.</p>

<p><a href="https://phabricator.kde.org/p/dhaumann/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;" rel="noreferrer">@dhaumann</a>: I don't feel demotivated by this and I would try to help more. I don't have time now but it is not because you reject my patch than I stop to want helping you.<br />
The behavior of auto-bracket is a personal choice.  I think the current code is frustrating to me but I understand some other people dislike my patch.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R39 KTextEditor</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D4234" rel="noreferrer">https://phabricator.kde.org/D4234</a></div></div><br /><div><strong>EMAIL PREFERENCES</strong><div><a href="https://phabricator.kde.org/settings/panel/emailpreferences/" rel="noreferrer">https://phabricator.kde.org/settings/panel/emailpreferences/</a></div></div><br /><div><strong>To: </strong>cactus, KTextEditor<br /><strong>Cc: </strong>anthonyfieroni, dhaumann, brauch, cullmann, kwrite-devel, Frameworks<br /></div>