D19785: DocumentPrivate: Review del/backspace

loh tar noreply at phabricator.kde.org
Tue May 28 14:44:15 BST 2019


loh.tar added a comment.


  That may fix it.
  
    diff --git a/src/document/katedocument.cpp b/src/document/katedocument.cpp
    index e365c380..7c24f67f 100644
    --- a/src/document/katedocument.cpp
    +++ b/src/document/katedocument.cpp
    @@ -3350,7 +3350,9 @@ void KTextEditor::DocumentPrivate::backspace(KTextEditor::ViewPrivate *view, con
     
         } else {
             // col == 0: wrap to previous line
    -        if (line > 0) {
    +        const Kate::TextLine textLine = m_buffer->plainLine(line - 1);
    +
    +        if (line > 0 && textLine) {
                 if (config()->wordWrap() && textLine->endsWith(QLatin1String(" "))) {
                     // gg: in hard wordwrap mode, backspace must also eat the trailing space
                     removeText(KTextEditor::Range(line - 1, textLine->length() - 1, line, 0));

REPOSITORY
  R39 KTextEditor

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

To: loh.tar, #ktexteditor, cullmann
Cc: safaalfulaij, kwrite-devel, kde-frameworks-devel, #ktexteditor, domson, michaelh, ngraham, bruns, demsking, cullmann, sars, dhaumann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20190528/effbb3d5/attachment.html>


More information about the KWrite-Devel mailing list