mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-31 03:31:19 +02:00
SynEdit/IDE: More multi caret
git-svn-id: trunk@48176 -
This commit is contained in:
parent
f821ac291e
commit
8651c30a2f
@ -1296,6 +1296,8 @@ type
|
||||
FBlockTabIndent: Integer;
|
||||
FCompletionLongLineHintInMSec: Integer;
|
||||
FCompletionLongLineHintType: TSynCompletionLongHintType;
|
||||
FMultiCaretDefaultColumnSelectMode: TSynPluginMultiCaretDefaultMode;
|
||||
FMultiCaretDefaultMode: TSynPluginMultiCaretDefaultMode;
|
||||
FPasExtendedKeywordsMode: Boolean;
|
||||
FHideSingleTabInWindow: Boolean;
|
||||
FPasStringKeywordMode: TSynPasStringMode;
|
||||
@ -1605,6 +1607,10 @@ type
|
||||
property UseTabHistory: Boolean read fUseTabHistory write fUseTabHistory;
|
||||
property MultiCaretOnColumnSelect: Boolean
|
||||
read FMultiCaretOnColumnSelect write FMultiCaretOnColumnSelect default True;
|
||||
property MultiCaretDefaultMode: TSynPluginMultiCaretDefaultMode
|
||||
read FMultiCaretDefaultMode write FMultiCaretDefaultMode default mcmMoveAllCarets;
|
||||
property MultiCaretDefaultColumnSelectMode: TSynPluginMultiCaretDefaultMode
|
||||
read FMultiCaretDefaultColumnSelectMode write FMultiCaretDefaultColumnSelectMode default mcmCancelOnCaretMove;
|
||||
|
||||
// Highlighter Pas
|
||||
property PasExtendedKeywordsMode: Boolean
|
||||
@ -4461,6 +4467,8 @@ begin
|
||||
fSynEditOptions := SynEditDefaultOptions;
|
||||
fSynEditOptions2 := SynEditDefaultOptions2;
|
||||
FMultiCaretOnColumnSelect := True;
|
||||
FMultiCaretDefaultMode := mcmMoveAllCarets;
|
||||
FMultiCaretDefaultColumnSelectMode := mcmCancelOnCaretMove;
|
||||
|
||||
// Display options
|
||||
fEditorFont := SynDefaultFontName;
|
||||
@ -5614,8 +5622,11 @@ begin
|
||||
end;
|
||||
|
||||
{$IFnDEF WithoutSynMultiCaret}
|
||||
if ASynEdit is TIDESynEditor then
|
||||
if ASynEdit is TIDESynEditor then begin
|
||||
TIDESynEditor(ASynEdit).MultiCaret.EnableWithColumnSelection := MultiCaretOnColumnSelect;
|
||||
TIDESynEditor(ASynEdit).MultiCaret.DefaultMode := FMultiCaretDefaultMode;
|
||||
TIDESynEditor(ASynEdit).MultiCaret.DefaultColumnSelectMode := FMultiCaretDefaultColumnSelectMode;
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
// Display options
|
||||
|
@ -200,7 +200,7 @@ object EditorGeneralOptionsFrame: TEditorGeneralOptionsFrame
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 19
|
||||
Top = 273
|
||||
Top = 292
|
||||
Width = 152
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
@ -214,7 +214,7 @@ object EditorGeneralOptionsFrame: TEditorGeneralOptionsFrame
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 218
|
||||
Height = 19
|
||||
Top = 273
|
||||
Top = 292
|
||||
Width = 152
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'OverwriteBlockCheckBox'
|
||||
@ -289,13 +289,13 @@ object EditorGeneralOptionsFrame: TEditorGeneralOptionsFrame
|
||||
end
|
||||
object BlockGroupDivider: TDividerBevel
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = MultiCaretOnColumnSelection
|
||||
AnchorSideTop.Control = chkMultiCaretMode
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 15
|
||||
Top = 252
|
||||
Top = 271
|
||||
Width = 434
|
||||
Caption = 'BlockGroupDivider'
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
@ -326,4 +326,26 @@ object EditorGeneralOptionsFrame: TEditorGeneralOptionsFrame
|
||||
Caption = 'MultiCaretOnColumnSelection'
|
||||
TabOrder = 17
|
||||
end
|
||||
object chkMultiCaretColumnMode: TCheckBox
|
||||
AnchorSideLeft.Control = EndKeyJumpsToNearestStartCheckBox
|
||||
AnchorSideTop.Control = MultiCaretOnColumnSelection
|
||||
Left = 218
|
||||
Height = 19
|
||||
Top = 227
|
||||
Width = 169
|
||||
Caption = 'chkMultiCaretColumnMode'
|
||||
TabOrder = 18
|
||||
end
|
||||
object chkMultiCaretMode: TCheckBox
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = MultiCaretOnColumnSelection
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 19
|
||||
Top = 246
|
||||
Width = 126
|
||||
BorderSpacing.Left = 6
|
||||
Caption = 'chkMultiCaretMode'
|
||||
TabOrder = 19
|
||||
end
|
||||
end
|
||||
|
@ -27,13 +27,15 @@ interface
|
||||
uses
|
||||
Classes, SysUtils, LCLProc, LCLType, StdCtrls, Controls, ExtCtrls, Graphics,
|
||||
EditorOptions, LazarusIDEStrConsts, IDEProcs, SourceSynEditor, IDEOptionsIntf,
|
||||
IDEUtils, SynEdit, SynBeautifier, SynHighlighterPas, DividerBevel;
|
||||
IDEUtils, SynEdit, SynBeautifier, SynHighlighterPas, SynPluginMultiCaret, DividerBevel;
|
||||
|
||||
type
|
||||
TPreviewEditor = TSynEdit;
|
||||
{ TEditorGeneralOptionsFrame }
|
||||
|
||||
TEditorGeneralOptionsFrame = class(TAbstractIDEOptionsEditor)
|
||||
chkMultiCaretColumnMode: TCheckBox;
|
||||
chkMultiCaretMode: TCheckBox;
|
||||
MultiCaretOnColumnSelection: TCheckBox;
|
||||
CursorSkipsTabCheckBox: TCheckBox;
|
||||
CaretGroupDivider: TDividerBevel;
|
||||
@ -140,6 +142,8 @@ begin
|
||||
HomeKeyJumpsToNearestStartCheckBox.Caption := dlgHomeKeyJumpsToNearestStart;
|
||||
EndKeyJumpsToNearestStartCheckBox.Caption := dlgEndKeyJumpsToNearestStart;
|
||||
MultiCaretOnColumnSelection.Caption := dlgMultiCaretOnColumnSelection;
|
||||
chkMultiCaretColumnMode.Caption := dlgMultiCaretColumnMode;
|
||||
chkMultiCaretMode.Caption := dlgMultiCaretMode;
|
||||
|
||||
// Block
|
||||
BlockGroupDivider.Caption := dlgBlockGroupOptions;
|
||||
@ -174,6 +178,8 @@ begin
|
||||
HomeKeyJumpsToNearestStartCheckBox.Checked := eoEnhanceHomeKey in SynEditOptions;
|
||||
EndKeyJumpsToNearestStartCheckBox.Checked := eoEnhanceEndKey in SynEditOptions2;
|
||||
MultiCaretOnColumnSelection.Checked := MultiCaretOnColumnSelect;
|
||||
chkMultiCaretColumnMode.Checked := MultiCaretDefaultColumnSelectMode = mcmMoveAllCarets;
|
||||
chkMultiCaretMode.Checked := MultiCaretDefaultMode = mcmMoveAllCarets;
|
||||
|
||||
// block
|
||||
PersistentBlockCheckBox.Checked := eoPersistentBlock in SynEditOptions2;
|
||||
@ -234,6 +240,15 @@ begin
|
||||
UpdateOptionFromBool(HomeKeyJumpsToNearestStartCheckBox.Checked, eoEnhanceHomeKey);
|
||||
UpdateOptionFromBool(EndKeyJumpsToNearestStartCheckBox.Checked, eoEnhanceEndKey);
|
||||
MultiCaretOnColumnSelect := MultiCaretOnColumnSelection.Checked;
|
||||
if chkMultiCaretColumnMode.Checked then
|
||||
MultiCaretDefaultColumnSelectMode := mcmMoveAllCarets
|
||||
else
|
||||
MultiCaretDefaultColumnSelectMode := mcmCancelOnCaretMove;
|
||||
if chkMultiCaretMode.Checked then
|
||||
MultiCaretDefaultMode := mcmMoveAllCarets
|
||||
else
|
||||
MultiCaretDefaultMode := mcmCancelOnCaretMove;
|
||||
|
||||
|
||||
// block
|
||||
UpdateOptionFromBool(PersistentBlockCheckBox.Checked, eoPersistentBlock);
|
||||
|
@ -1693,6 +1693,8 @@ resourcestring
|
||||
dlgHomeKeyJumpsToNearestStart = 'Home key jumps to nearest start';
|
||||
dlgEndKeyJumpsToNearestStart = 'End key jumps to nearest end';
|
||||
dlgMultiCaretOnColumnSelection = 'Enable multi caret for column selection';
|
||||
dlgMultiCaretColumnMode = 'Multi-caret (column-select) move with cursor';
|
||||
dlgMultiCaretMode = 'Multi-caret move with cursor';
|
||||
dlgColorLink = '(Edit Color)';
|
||||
dlgKeyLink = '(Edit Key)';
|
||||
dlgBracketHighlight = 'Bracket highlight';
|
||||
|
Loading…
Reference in New Issue
Block a user