diff --git a/RedPandaIDE/editor.cpp b/RedPandaIDE/editor.cpp index 41ec1d3a..7fd56368 100644 --- a/RedPandaIDE/editor.cpp +++ b/RedPandaIDE/editor.cpp @@ -512,11 +512,11 @@ void Editor::keyPressEvent(QKeyEvent *event) handled = true; QStringList params; QStringList insertString; - insertString:= TStringList.Create; - try - insertString.Add(''); - funcName := fParser.FindFunctionDoc(fFileName,fText.CaretY+1, - params,isVoid); + insertString.append(""); + bool isVoid; + QString funcName = mParser->FindFunctionDoc(mFilename, + caretY()+1, + params,isVoid); if funcName <> '' then begin insertString.Add(' * @brief '+USER_CODE_IN_INSERT_POS); insertString.Add(' * '); @@ -533,10 +533,7 @@ void Editor::keyPressEvent(QKeyEvent *event) insertString.Add(' **/'); end; InsertUserCodeIn(insertString.Text); - finally - insertString.Free; - params.Free; - end; + end else if fText.Highlighter.GetIsLastLineCommentNotFinish(fText.Lines.Ranges[fText.CaretY-2]) then s:=trimLeft(fText.LineText); if StartsStr('* ',s) then begin diff --git a/RedPandaIDE/editor.h b/RedPandaIDE/editor.h index c21d3363..490e3eac 100644 --- a/RedPandaIDE/editor.h +++ b/RedPandaIDE/editor.h @@ -212,6 +212,7 @@ private: void updateFunctionTip(); void clearUserCodeInTabStops(); + void popUserCodeInTabStops(); private: