mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: Viewer - allow cm_WrapText command in the code view mode (experimental)
This commit is contained in:
parent
ea52d64c6e
commit
c676d62ec3
1 changed files with 34 additions and 2 deletions
|
|
@ -62,7 +62,7 @@ uses
|
|||
uFileSource, fModView, Types, uThumbnails, uFormCommands, uOSForms,Clipbrd,
|
||||
uExifReader, KASStatusBar, SynEdit, uShowForm, uRegExpr, uRegExprU,
|
||||
Messages, fEditSearch, uMasks, uSearchTemplate, uFileSourceOperation,
|
||||
uFileSourceCalcStatisticsOperation, KASComCtrls;
|
||||
uFileSourceCalcStatisticsOperation, KASComCtrls, LCLVersion;
|
||||
|
||||
type
|
||||
|
||||
|
|
@ -390,6 +390,9 @@ type
|
|||
FPluginEncoding: Integer;
|
||||
//---------------------
|
||||
FSynEditOriginalText: String;
|
||||
{$if lcl_fullversion >= 4990000}
|
||||
FSynEditWrap: TLazSynEditPlugin;
|
||||
{$endif}
|
||||
FSearchOptions: TEditSearchOptions;
|
||||
FHighlighter: TSynCustomHighlighter;
|
||||
//---------------------
|
||||
|
|
@ -537,6 +540,9 @@ uses
|
|||
fPrintSetup, uFindFiles, uAdministrator, uOfficeXML, uHighlighterProcs, dmHigh,
|
||||
SynEditTypes, uFile, uFileSystemFileSource, uFileProcs, uOperationsManager,
|
||||
uFileSourceOperationOptions
|
||||
{$if lcl_fullversion >= 4990000}
|
||||
, SynEditWrappedView
|
||||
{$endif}
|
||||
{$IFDEF LCLGTK2}
|
||||
, uGraphics
|
||||
{$ENDIF}
|
||||
|
|
@ -3070,6 +3076,11 @@ begin
|
|||
MarkupInfo.Background:= clBtnFace;
|
||||
MarkupInfo.Foreground:= clBtnText;
|
||||
end;
|
||||
{$if lcl_fullversion >= 4990000}
|
||||
if gViewerWrapText then begin
|
||||
FSynEditWrap:= TLazSynEditLineWrapPlugin.Create(SynEdit);
|
||||
end;
|
||||
{$endif}
|
||||
SynEdit.Options:= gEditorSynEditOptions;
|
||||
SynEdit.TabWidth := gEditorSynEditTabWidth;
|
||||
SynEdit.RightEdge := gEditorSynEditRightEdge;
|
||||
|
|
@ -3584,7 +3595,11 @@ begin
|
|||
|
||||
actGotoLine.Enabled := (Panel = pnlCode);
|
||||
actShowCaret.Enabled := (Panel = pnlText) or (Panel = pnlCode);
|
||||
actWrapText.Enabled := (bPlugin and FWlxModule.CanCommand) or ((Panel = pnlText) and (ViewerControl.Mode in [vcmText, vcmWrap]));
|
||||
actWrapText.Enabled := (bPlugin and FWlxModule.CanCommand) or ((Panel = pnlText) and (ViewerControl.Mode in [vcmText, vcmWrap]))
|
||||
{$if lcl_fullversion >= 4990000}
|
||||
or (Panel = pnlCode);
|
||||
{$endif}
|
||||
;
|
||||
|
||||
miGotoLine.Visible := (Panel = pnlCode);
|
||||
miDiv5.Visible := (Panel = pnlText) or (Panel = pnlCode);
|
||||
|
|
@ -4166,6 +4181,10 @@ begin
|
|||
end;
|
||||
|
||||
procedure TfrmViewer.cm_WrapText(const Params: array of string);
|
||||
{$if lcl_fullversion >= 4990000}
|
||||
var
|
||||
TopLine: Integer;
|
||||
{$endif}
|
||||
begin
|
||||
gViewerWrapText:= not gViewerWrapText;
|
||||
actWrapText.Checked:= gViewerWrapText;
|
||||
|
|
@ -4174,6 +4193,19 @@ begin
|
|||
FWlxModule.CallListSendCommand(lc_newparams, PluginShowFlags)
|
||||
else if not miGraphics.Checked then
|
||||
begin
|
||||
{$if lcl_fullversion >= 4990000}
|
||||
if miCode.Checked then
|
||||
begin
|
||||
TopLine:= SynEdit.TopLine;
|
||||
if gViewerWrapText then
|
||||
FSynEditWrap:= TLazSynEditLineWrapPlugin.Create(SynEdit)
|
||||
else begin
|
||||
FreeAndNil(FSynEditWrap);
|
||||
end;
|
||||
SynEdit.TopLine:= TopLine;
|
||||
end
|
||||
else
|
||||
{$endif}
|
||||
if ViewerControl.Mode in [vcmText, vcmWrap] then
|
||||
begin
|
||||
ViewerControl.Mode:= WRAP_MODE[gViewerWrapText];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue