Added new feature: Auto Disable (disable auto-update if plugin has more than xxx lines, should prevent lags)
This commit is contained in:
parent
efe4b674e2
commit
6ea52a9a08
|
@ -115,7 +115,7 @@ AutoIncBuild=1
|
||||||
MajorVer=1
|
MajorVer=1
|
||||||
MinorVer=3
|
MinorVer=3
|
||||||
Release=0
|
Release=0
|
||||||
Build=14
|
Build=16
|
||||||
Debug=0
|
Debug=0
|
||||||
PreRelease=0
|
PreRelease=0
|
||||||
Special=0
|
Special=0
|
||||||
|
@ -126,7 +126,7 @@ CodePage=1252
|
||||||
[Version Info Keys]
|
[Version Info Keys]
|
||||||
CompanyName=AMX Mod X Dev Team
|
CompanyName=AMX Mod X Dev Team
|
||||||
FileDescription=
|
FileDescription=
|
||||||
FileVersion=1.3.0.14
|
FileVersion=1.3.0.16
|
||||||
InternalName=
|
InternalName=
|
||||||
LegalCopyright=
|
LegalCopyright=
|
||||||
LegalTrademarks=
|
LegalTrademarks=
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -21,6 +21,8 @@ type
|
||||||
eCode: TStringList;
|
eCode: TStringList;
|
||||||
|
|
||||||
eAutoComplete, eCallTips, eKeywords: string;
|
eAutoComplete, eCallTips, eKeywords: string;
|
||||||
|
eLastActive: Integer;
|
||||||
|
eActive: Integer;
|
||||||
protected
|
protected
|
||||||
procedure Execute; override;
|
procedure Execute; override;
|
||||||
procedure GetCode;
|
procedure GetCode;
|
||||||
|
@ -37,6 +39,16 @@ uses UnitfrmMain, UnitLanguages, UnitMainTools, UnitCodeUtils,
|
||||||
{ TCodeExplorerUpdater }
|
{ TCodeExplorerUpdater }
|
||||||
|
|
||||||
procedure TCodeExplorerUpdater.Execute;
|
procedure TCodeExplorerUpdater.Execute;
|
||||||
|
function CheckAU: Boolean;
|
||||||
|
begin
|
||||||
|
Result := True;
|
||||||
|
if (eLastActive = eActive) and (frmSettings.chkAUDisable.Checked) then begin
|
||||||
|
if frmMain.sciEditor.Lines.Count > StrToIntDef(frmSettings.txtAUDisable.Text, 1500) then
|
||||||
|
Result := False;
|
||||||
|
end;
|
||||||
|
eLastActive := eActive;
|
||||||
|
end;
|
||||||
|
|
||||||
var eStr: TStringList;
|
var eStr: TStringList;
|
||||||
begin
|
begin
|
||||||
eCode := TStringList.Create;
|
eCode := TStringList.Create;
|
||||||
|
@ -59,9 +71,9 @@ begin
|
||||||
eKeywords := '';
|
eKeywords := '';
|
||||||
|
|
||||||
if (not Application.Terminated) and (Started) and (not frmMain.pnlLoading.Visible) and (frmMain.trvExplorer.Visible) then begin
|
if (not Application.Terminated) and (Started) and (not frmMain.pnlLoading.Visible) and (frmMain.trvExplorer.Visible) then begin
|
||||||
if Plugin_UpdateCodeExplorer(GetCurrLang.Name, ActiveDoc.FileName, frmMain.tsMain.Items[frmMain.tsMain.ActiveTabIndex].Caption, True) then begin
|
if (Plugin_UpdateCodeExplorer(GetCurrLang.Name, ActiveDoc.FileName, frmMain.tsMain.Items[frmMain.tsMain.ActiveTabIndex].Caption, True)) and (frmMain.tsMain.ActiveTabIndex = 0) then begin
|
||||||
try
|
try
|
||||||
if (frmMain.tsMain.ActiveTabIndex = 0) then begin
|
if CheckAU then begin
|
||||||
if Plugin_UpdateCodeExplorer(GetCurrLang.Name, ActiveDoc.FileName, frmMain.tsMain.Items[frmMain.tsMain.ActiveTabIndex].Caption, True) then begin
|
if Plugin_UpdateCodeExplorer(GetCurrLang.Name, ActiveDoc.FileName, frmMain.tsMain.Items[frmMain.tsMain.ActiveTabIndex].Caption, True) then begin
|
||||||
// analyze code
|
// analyze code
|
||||||
with ParseCodePawn(eCode, ExtractFileName(ActiveDoc.FileName)) do begin
|
with ParseCodePawn(eCode, ExtractFileName(ActiveDoc.FileName)) do begin
|
||||||
|
@ -114,6 +126,7 @@ end;
|
||||||
procedure TCodeExplorerUpdater.GetCode;
|
procedure TCodeExplorerUpdater.GetCode;
|
||||||
begin
|
begin
|
||||||
eCode.Assign(frmMain.sciEditor.Lines);
|
eCode.Assign(frmMain.sciEditor.Lines);
|
||||||
|
eActive := ActiveDoc.Index;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetNode(eText: string): TTreeNode;
|
function GetNode(eText: string): TTreeNode;
|
||||||
|
|
|
@ -631,7 +631,9 @@ begin
|
||||||
frmAutoIndent.chkIndentOpeningBrace.Checked := eConfig.ReadBool('Editor', 'IndentOpeningBrace', True);
|
frmAutoIndent.chkIndentOpeningBrace.Checked := eConfig.ReadBool('Editor', 'IndentOpeningBrace', True);
|
||||||
frmAutoIndent.chkUnindentPressingClosingBrace.Checked := eConfig.ReadBool('Editor', 'UnindentClosingBrace', True);
|
frmAutoIndent.chkUnindentPressingClosingBrace.Checked := eConfig.ReadBool('Editor', 'UnindentClosingBrace', True);
|
||||||
frmAutoIndent.chkUnindentLine.Checked := eConfig.ReadBool('Editor', 'UnindentEmptyLine', False);
|
frmAutoIndent.chkUnindentLine.Checked := eConfig.ReadBool('Editor', 'UnindentEmptyLine', False);
|
||||||
|
frmSettings.chkAUDisable.Checked := eConfig.ReadString('Editor', 'AutoDisable', '1500') <> '-1';
|
||||||
|
if eConfig.ReadString('Editor', 'AutoDisable', '1500') <> '-1' then
|
||||||
|
frmSettings.txtAUDisable.Text := eConfig.ReadString('Editor', 'AutoDisable', '1500');
|
||||||
if foldFold in frmMain.sciEditor.Folding then begin
|
if foldFold in frmMain.sciEditor.Folding then begin
|
||||||
case frmMain.sciEditor.FoldMarkerType of
|
case frmMain.sciEditor.FoldMarkerType of
|
||||||
sciMarkArrows: frmSettings.cboCodeFolding.ItemIndex := 0;
|
sciMarkArrows: frmSettings.cboCodeFolding.ItemIndex := 0;
|
||||||
|
|
|
@ -52,14 +52,14 @@ end;
|
||||||
|
|
||||||
function ParseCodePawn(eCode: TStringList; FileName: string; IsRecursive: Boolean = False): TPawnParseResult;
|
function ParseCodePawn(eCode: TStringList; FileName: string; IsRecursive: Boolean = False): TPawnParseResult;
|
||||||
var i, k: integer;
|
var i, k: integer;
|
||||||
eString, eTemp, eBackup: string;
|
eString, eTemp, eBackup: string;
|
||||||
eStr, ePreEvents: TStringList;
|
eStr, ePreEvents: TStringList;
|
||||||
eStartLine, eBracesOpen: Integer;
|
eStartLine, eBracesOpen: Integer;
|
||||||
eTimeToSleep: Integer;
|
eTimeToSleep: Integer;
|
||||||
eAddingEnum: Integer;
|
eAddingEnum: Integer;
|
||||||
eTempResult: TPawnParseResult;
|
eTempResult: TPawnParseResult;
|
||||||
eProcedureAdded: Boolean;
|
eProcedureAdded: Boolean;
|
||||||
eCActive: Boolean;
|
eCActive: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := TPawnParseResult.Create;
|
Result := TPawnParseResult.Create;
|
||||||
if not IsRecursive then
|
if not IsRecursive then
|
||||||
|
|
|
@ -553,7 +553,11 @@ begin
|
||||||
eConfig.WriteBool('Editor', 'UnindentClosingBrace', frmAutoIndent.chkUnindentPressingClosingBrace.Checked);
|
eConfig.WriteBool('Editor', 'UnindentClosingBrace', frmAutoIndent.chkUnindentPressingClosingBrace.Checked);
|
||||||
eConfig.WriteBool('Editor', 'UnindentEmptyLine', frmAutoIndent.chkUnindentLine.Checked);
|
eConfig.WriteBool('Editor', 'UnindentEmptyLine', frmAutoIndent.chkUnindentLine.Checked);
|
||||||
eConfig.WriteBool('Editor', 'Disable_AC', frmSettings.chkDisableAC.Checked);
|
eConfig.WriteBool('Editor', 'Disable_AC', frmSettings.chkDisableAC.Checked);
|
||||||
eConfig.WriteBool('Editor', 'Disable_CT', frmSettings.chkDisableCT.Checked);
|
eConfig.WriteBool('Editor', 'Disable_CT', frmSettings.chkDisableCT.Checked);
|
||||||
|
if frmSettings.chkAUDisable.Checked then
|
||||||
|
eConfig.WriteString('Editor', 'AutoDisable', frmSettings.txtAUDisable.Text)
|
||||||
|
else
|
||||||
|
eConfig.WriteString('Editor', 'AutoDisable', '-1');
|
||||||
{ Editor }
|
{ Editor }
|
||||||
if FileExists(sciPropertyLoader.FileName) then
|
if FileExists(sciPropertyLoader.FileName) then
|
||||||
sciPropertyLoader.Save;
|
sciPropertyLoader.Save;
|
||||||
|
|
|
@ -61,7 +61,7 @@ object frmSettings: TfrmSettings
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 353
|
Width = 353
|
||||||
Height = 260
|
Height = 260
|
||||||
ActivePage = jspHighlighter
|
ActivePage = jspCTSettings
|
||||||
PropagateEnable = False
|
PropagateEnable = False
|
||||||
Align = alClient
|
Align = alClient
|
||||||
OnChange = jplSettingsChange
|
OnChange = jplSettingsChange
|
||||||
|
@ -1670,6 +1670,31 @@ object frmSettings: TfrmSettings
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
object chkAUDisable: TFlatCheckBox
|
||||||
|
Left = 8
|
||||||
|
Top = 166
|
||||||
|
Width = 297
|
||||||
|
Height = 17
|
||||||
|
Caption = 'Disable Auto-Update if plugin has more than lines'
|
||||||
|
TabOrder = 2
|
||||||
|
TabStop = True
|
||||||
|
end
|
||||||
|
object txtAUDisable: TFlatEdit
|
||||||
|
Left = 238
|
||||||
|
Top = 166
|
||||||
|
Width = 37
|
||||||
|
Height = 16
|
||||||
|
ColorFlat = clWhite
|
||||||
|
Font.Charset = DEFAULT_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -8
|
||||||
|
Font.Name = 'Tahoma'
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
TabOrder = 3
|
||||||
|
Text = '1500'
|
||||||
|
OnExit = txtAUDisableExit
|
||||||
|
end
|
||||||
end
|
end
|
||||||
object lblCurrSetting: TLabel
|
object lblCurrSetting: TLabel
|
||||||
Left = 0
|
Left = 0
|
||||||
|
|
|
@ -193,6 +193,8 @@ type
|
||||||
chkMakeBaks: TFlatCheckBox;
|
chkMakeBaks: TFlatCheckBox;
|
||||||
chkDisableAC: TFlatCheckBox;
|
chkDisableAC: TFlatCheckBox;
|
||||||
chkDisableCT: TFlatCheckBox;
|
chkDisableCT: TFlatCheckBox;
|
||||||
|
chkAUDisable: TFlatCheckBox;
|
||||||
|
txtAUDisable: TFlatEdit;
|
||||||
procedure jplSettingsChange(Sender: TObject);
|
procedure jplSettingsChange(Sender: TObject);
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure FormDestroy(Sender: TObject);
|
procedure FormDestroy(Sender: TObject);
|
||||||
|
@ -255,6 +257,7 @@ type
|
||||||
Shift: TShiftState);
|
Shift: TShiftState);
|
||||||
procedure cboFontChange(Sender: TObject);
|
procedure cboFontChange(Sender: TObject);
|
||||||
procedure cmdBrowseLangDirClick(Sender: TObject);
|
procedure cmdBrowseLangDirClick(Sender: TObject);
|
||||||
|
procedure txtAUDisableExit(Sender: TObject);
|
||||||
public
|
public
|
||||||
Foreground, Background: TColor;
|
Foreground, Background: TColor;
|
||||||
CaretFore, CaretBack: TColor;
|
CaretFore, CaretBack: TColor;
|
||||||
|
@ -1002,4 +1005,10 @@ begin
|
||||||
txtLangDir.Text := eStr;
|
txtLangDir.Text := eStr;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TfrmSettings.txtAUDisableExit(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if not IsNumeric(txtAUDisable.Text) then
|
||||||
|
txtAUDisable.Text := '1500';
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user