<table><tr><td style="">mwolff requested changes to this revision.<br />mwolff added a comment.<br />This revision now requires changes to proceed.
</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/D18793">View Revision</a></tr></table><br /><div><div><p>we override execution in our own completion models, so this patch will only change the behavior for the builtin word and keyword completion models in ktexteditor I believe</p>

<p>that said, I think it makes sense to insert the word everywhere in block selection, it shouldn't be different from typing text.</p>

<p>so +1 for the idea, but -1 on the actual implementation:</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">we need to have a unit test for this new behavior</li>
<li class="remarkup-list-item">we should introduce new helper API to make it easier to opt-in to this new behavior and reduce the if/else depth. This would also make it easier for us in KDevelop to change our behavior accordingly. I believe the code completion execution code should basically be agnostic to the block selection mode. I.e. instead of the proposed</li>
</ul>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">if (completeBlockSelection) {
    removeText
    typeChars
} else {
    replaceText
}</pre></div>

<p>it should always just call "replaceText" with the the block selection range and then internal API should duplicate the text, if the selection is a block selection</p>

<p>as-is, this patch adds too much code duplication</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/D18793">https://phabricator.kde.org/D18793</a></div></div><br /><div><strong>To: </strong>ahmadsamir, KTextEditor, cullmann, dhaumann, KDevelop, mwolff<br /><strong>Cc: </strong>mwolff, kde-frameworks-devel, kwrite-devel, KTextEditor, gennad, michaelh, ngraham, bruns, demsking, cullmann, sars, dhaumann<br /></div>