diff --git a/ide/exttooleditdlg.pas b/ide/exttooleditdlg.pas index 6d0fefdb73..b57f1476cd 100644 --- a/ide/exttooleditdlg.pas +++ b/ide/exttooleditdlg.pas @@ -904,7 +904,7 @@ begin else s:='$'+fTransferMacros[i].Name+'()'; ALine := MemoParameters.CaretPos.Y; - If MemoParameters.Lines.Count = 0 Then + if ALine >= MemoParameters.Lines.Count then MemoParameters.Lines.Add(''); AStr := MemoParameters.Lines[Aline]; MemoParameters.Lines[Aline] := AStr + s; diff --git a/lcl/interfaces/qt/qtprivate.pp b/lcl/interfaces/qt/qtprivate.pp index 9747321cce..7f7d20fdef 100644 --- a/lcl/interfaces/qt/qtprivate.pp +++ b/lcl/interfaces/qt/qtprivate.pp @@ -428,12 +428,13 @@ begin // simplified because of issue #29670 // allow insert invalid index like others do - if Index >= FStringlist.Count then + if Index >= FStringList.Count then Index := FStringList.Add(S) else FStringList.Insert(Index, S); W := GetUTF8String(S); TQtTextEdit(FOwner.Handle).insertLine(Index, W); + FTextChanged := False; // FStringList is already updated, no need to update from WS. end; procedure TQtMemoStrings.LoadFromFile(const FileName: string);