D17740: Fix crash in extendSelection

Pavel Khlebovich noreply at phabricator.kde.org
Sun Dec 23 13:34:19 GMT 2018


pavelkh added a comment.


  This happens because loc() expects character-space indices, while selection-space indices are provided. The semantic of selection-space is that the index of the character after the last one select the last character.
  
  So, in addition to relying on getCharacterPosition(..., false) (which is now called correctly, thanks!) the proposed diff should do additional clamping of old and current selections. Maybe make a separate function for this in the future?
  
  Note that you won't be able to reproduce this in release build: asserts are disabled and loc() clamps the character to exactly correct values.

REPOSITORY
  R319 Konsole

REVISION DETAIL
  https://phabricator.kde.org/D17740

To: sandsmark, #konsole, hindenburg, pavelkh, cfeck
Cc: konsole-devel, #konsole, thsurrel, ngraham, maximilianocuria, hindenburg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/konsole-devel/attachments/20181223/be6072e5/attachment.html>


More information about the konsole-devel mailing list