Skip to content

Commit

Permalink
Fix crash when moving caret left then pressing control down
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownShadow200 committed Apr 10, 2019
1 parent 69e59db commit dfc203a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Widgets.c
Expand Up @@ -1694,9 +1694,10 @@ static void ChatInputWidget_DownKey(struct InputWidget* w) {

if (InputWidget_ControlDown()) {
lines = w->GetMaxLines();
if (w->CaretPos == -1 || w->CaretPos >= (lines - 1) * INPUTWIDGET_LEN) return;
if (w->CaretPos == -1) return;

w->CaretPos += INPUTWIDGET_LEN;
if (w->CaretPos >= w->Text.length) { w->CaretPos = -1; }
InputWidget_UpdateCaret(w);
return;
}
Expand Down

0 comments on commit dfc203a

Please sign in to comment.