<table><tr><td style="">pavelkh created this revision.<br />pavelkh added reviewers: Konsole, hindenburg, cfeck.<br />Herald added a project: Konsole.<br />Herald added a subscriber: konsole-devel.<br />pavelkh requested review of this revision.
</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/D16159">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>This is a reimplemented <a href="https://phabricator.kde.org/R319:914067d14a6a27b59bba1c53cc18cb67eb9811fc" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">914067d14a6a27b59bba1c53cc18cb67eb9811fc</a> (hinted by <a href="https://phabricator.kde.org/p/cfeck/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;">@cfeck</a>), plus a refactoring of TerminalDisplay::findWordStart()</p>

<p>findWordStart() had bounds check issues and an off-by-one for the case when the acquired region was more than two screens down.</p>

<p>TerminalDisplay::findWordEnd() is very similarly implemented, but I haven't found a case where it fails, so I haven't touched it.</p>

<p>Since <a href="https://phabricator.kde.org/R319:914067d14a6a27b59bba1c53cc18cb67eb9811fc" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">914067d14a6a27b59bba1c53cc18cb67eb9811fc</a> caused a revert, I've tested the changes thoroughly (the cases are in the Test Plan below).</p>

<p>Fixes BUG 399109</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Corner cases tested (everything was run under valgrind, since I had no crashes without it pre - <a href="https://phabricator.kde.org/R319:f98c752bce9fa11f1e81cf6ef8c02b3c3861c341" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">f98c752bce9fa11f1e81cf6ef8c02b3c3861c341</a>):</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">At the end of the word, current Konsole doesn't select "@" at the end of the word when double-clicking, but selects it when the mouse is moved. With the introduced changes the behavior is to consistently ignore the last "@" character.</li>
<li class="remarkup-list-item">When 10K lines buffer is underfilled, dragged doubleclick+scrolled up by dragging the mouse above the terminal (this generates valgrind warnings on <a href="https://phabricator.kde.org/R319:5a31b4af6ddaba36866d092cb169faec3ca2cef1" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">5a31b4af6ddaba36866d092cb169faec3ca2cef1</a> that might have caused Konsole to crash)</li>
<li class="remarkup-list-item">Same with overfilled 10K lines buffer.</li>
<li class="remarkup-list-item">With decreased window size and some chars hidden, dblclick and drag up and down to the end of the buffer. The ends of the string are trimmed (like in current console), the rest of the string is properly selected.</li>
<li class="remarkup-list-item">With increased window size and padded chars, prod the buffer limits. Long lines are broken into separate lines -- no difference vs current Konsole.</li>
</ul></div></div><br /><div><strong>REPOSITORY</strong><div><div>R319 Konsole</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D16159">https://phabricator.kde.org/D16159</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/TerminalDisplay.cpp</div></div></div><br /><div><strong>To: </strong>pavelkh, Konsole, hindenburg, cfeck<br /><strong>Cc: </strong>cfeck, konsole-devel, herrold, ngraham, maximilianocuria, hindenburg<br /></div>