From ae9c90236fcef0372d84e5f5d62452103d446b7a Mon Sep 17 00:00:00 2001 From: royqh1979 Date: Sat, 2 Oct 2021 10:05:48 +0800 Subject: [PATCH] work save --- RedPandaIDE/editor.cpp | 15 ++++++--------- RedPandaIDE/editor.h | 1 + 2 files changed, 7 insertions(+), 9 deletions(-) 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: