Skip to content

Commit

Permalink
Fixed|Widgets: Crash moving cursor when editor is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Sep 1, 2019
1 parent f37c27c commit dd99bdd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions doomsday/libs/shell/src/abstractlineeditor.cpp
Expand Up @@ -146,8 +146,9 @@ DE_PIMPL(AbstractLineEditor)
const LineBytePos linePos = lineCursorPos();

// Check for no room.
if (!linePos.line && lineOff < 0) return false;
if (linePos.line == wraps->height() - 1 && lineOff > 0) return false;
if (text.empty()) return false;
if (linePos.line <= 0 && lineOff < 0) return false;
if (linePos.line >= wraps->height() - 1 && lineOff > 0) return false;

const auto destWidth = wraps->rangeWidth({lineSpan(linePos.line).range.begin(), cursorPtr()});

Expand Down

0 comments on commit dd99bdd

Please sign in to comment.