mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: Viewer - Max code size limit (fixes #1461)
(cherry picked from commit 72ac5aed61)
This commit is contained in:
parent
c5de90352a
commit
26d8defe26
2 changed files with 10 additions and 0 deletions
|
|
@ -2673,6 +2673,12 @@ begin
|
|||
Exit(False);
|
||||
end;
|
||||
|
||||
if Result and not bForce then
|
||||
begin
|
||||
if (mbFileSize(sFileName) > (gMaxCodeSize * $100000)) then
|
||||
Exit(False);
|
||||
end;
|
||||
|
||||
if Result then
|
||||
begin
|
||||
FHighlighter:= GetHighlighterFromFileExt(dmHighl.SynHighlighterList, ExtractFileExt(sFileName));
|
||||
|
|
|
|||
|
|
@ -615,6 +615,7 @@ var
|
|||
gImagePaintWidth,
|
||||
gColCount,
|
||||
gViewerMode,
|
||||
gMaxCodeSize,
|
||||
gMaxTextWidth,
|
||||
gTabSpaces : Integer;
|
||||
gImagePaintColor,
|
||||
|
|
@ -2090,6 +2091,7 @@ begin
|
|||
gImagePaintWidth := 5;
|
||||
gColCount := 1;
|
||||
gTabSpaces := 8;
|
||||
gMaxCodeSize := 128;
|
||||
gMaxTextWidth := 1024;
|
||||
gImagePaintColor := clRed;
|
||||
gTextPosition:= 0;
|
||||
|
|
@ -3165,6 +3167,7 @@ begin
|
|||
gColCount := GetValue(Node, 'NumberOfColumns', gColCount);
|
||||
gTabSpaces := GetValue(Node, 'TabSpaces', gTabSpaces);
|
||||
gMaxTextWidth := GetValue(Node, 'MaxTextWidth', gMaxTextWidth);
|
||||
gMaxCodeSize := GetValue(Node, 'MaxCodeSize', gMaxCodeSize);
|
||||
gViewerMode := GetValue(Node, 'ViewerMode' , gViewerMode);
|
||||
gPrintMargins := GetValue(Node, 'PrintMargins' , gPrintMargins);
|
||||
gShowCaret := GetValue(Node, 'ShowCaret' , gShowCaret);
|
||||
|
|
@ -3753,6 +3756,7 @@ begin
|
|||
SetValue(Node, 'PaintWidth', gImagePaintWidth);
|
||||
SetValue(Node, 'NumberOfColumns', gColCount);
|
||||
SetValue(Node, 'TabSpaces', gTabSpaces);
|
||||
SetValue(Node, 'MaxCodeSize', gMaxCodeSize);
|
||||
SetValue(Node, 'MaxTextWidth', gMaxTextWidth);
|
||||
SetValue(Node, 'ViewerMode' , gViewerMode);
|
||||
SetValue(Node, 'PrintMargins', gPrintMargins);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue