ADD: Editor - 'Group Undo' option (#1331)

This commit is contained in:
Skif-off 2023-11-04 14:59:21 +04:00 committed by GitHub
commit 38e7edf2cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

View file

@ -113,6 +113,15 @@ inherited frmOptionsEditor: TfrmOptionsEditor
Caption = 'Smart Tabs'
TabOrder = 6
end
object chkGroupUndo: TCheckBox
Left = 323
Height = 24
Hint = 'All continuous changes of the same type will be processed in one call instead of undoing/redoing each one'
Top = 63
Width = 226
Caption = 'Group Undo'
TabOrder = 7
end
end
object edTabWidth: TEdit
AnchorSideLeft.Control = lblTabWidth

View file

@ -14,6 +14,8 @@
{"hash":127944307,"name":"tfrmoptionseditor.chktabindent.caption","sourcebytes":[84,97,98,32,105,110,100,101,110,116,115,32,98,108,111,99,107,115],"value":"Tab indents blocks"},
{"hash":145722565,"name":"tfrmoptionseditor.chksmarttabs.hint","sourcebytes":[87,104,101,110,32,117,115,105,110,103,32,60,84,97,98,62,32,107,101,121,44,32,99,97,114,101,116,32,119,105,108,108,32,103,111,32,116,111,32,116,104,101,32,110,101,120,116,32,110,111,110,45,115,112,97,99,101,32,99,104,97,114,97,99,116,101,114,32,111,102,32,116,104,101,32,112,114,101,118,105,111,117,115,32,108,105,110,101],"value":"When using <Tab> key, caret will go to the next non-space character of the previous line"},
{"hash":157287443,"name":"tfrmoptionseditor.chksmarttabs.caption","sourcebytes":[83,109,97,114,116,32,84,97,98,115],"value":"Smart Tabs"},
{"hash":53591125,"name":"tfrmoptionseditor.chkgroupundo.hint","sourcebytes":[65,108,108,32,99,111,110,116,105,110,117,111,117,115,32,99,104,97,110,103,101,115,32,111,102,32,116,104,101,32,115,97,109,101,32,116,121,112,101,32,119,105,108,108,32,98,101,32,112,114,111,99,101,115,115,101,100,32,105,110,32,111,110,101,32,99,97,108,108,32,105,110,115,116,101,97,100,32,111,102,32,117,110,100,111,105,110,103,47,114,101,100,111,105,110,103,32,101,97,99,104,32,111,110,101],"value":"All continuous changes of the same type will be processed in one call instead of undoing/redoing each one"},
{"hash":203517391,"name":"tfrmoptionseditor.chkgroupundo.caption","sourcebytes":[71,114,111,117,112,32,85,110,100,111],"value":"Group Undo"},
{"hash":61127412,"name":"tfrmoptionseditor.edtabwidth.hint","sourcebytes":[80,108,101,97,115,101,32,110,111,116,101,32,116,104,97,116,32,116,104,101,32,34,83,109,97,114,116,32,84,97,98,115,34,32,111,112,116,105,111,110,32,116,97,107,101,115,32,112,114,101,99,101,100,101,110,99,101,32,111,118,101,114,32,116,104,101,32,116,97,98,117,108,97,116,105,111,110,32,116,111,32,98,101,32,112,101,114,102,111,114,109,101,100],"value":"Please note that the \"Smart Tabs\" option takes precedence over the tabulation to be performed"},
{"hash":61127412,"name":"tfrmoptionseditor.lbltabwidth.hint","sourcebytes":[80,108,101,97,115,101,32,110,111,116,101,32,116,104,97,116,32,116,104,101,32,34,83,109,97,114,116,32,84,97,98,115,34,32,111,112,116,105,111,110,32,116,97,107,101,115,32,112,114,101,99,101,100,101,110,99,101,32,111,118,101,114,32,116,104,101,32,116,97,98,117,108,97,116,105,111,110,32,116,111,32,98,101,32,112,101,114,102,111,114,109,101,100],"value":"Please note that the \"Smart Tabs\" option takes precedence over the tabulation to be performed"},
{"hash":131735034,"name":"tfrmoptionseditor.lbltabwidth.caption","sourcebytes":[84,97,98,32,119,105,100,116,104,58],"value":"Tab width:"},

View file

@ -48,6 +48,7 @@ type
lblTabWidth: TLabel;
edTabWidth: TEdit;
chkSmartTabs: TCheckBox;
chkGroupUndo: TCheckBox;
seeRightEdge: TSpinEditEx;
seeBlockIndent: TSpinEditEx;
protected
@ -91,6 +92,7 @@ begin
chkTabIndent.Checked := eoTabIndent in gEditorSynEditOptions;
chkSmartTabs.Checked := eoSmartTabs in gEditorSynEditOptions;
chkRightEdge.Checked := not (eoHideRightMargin in gEditorSynEditOptions);
chkGroupUndo.Checked := eoGroupUndo in gEditorSynEditOptions;
edTabWidth.Text := IntToStr(gEditorSynEditTabWidth);
seeBlockIndent.Value := gEditorSynEditBlockIndent;
seeRightEdge.Value := gEditorSynEditRightEdge;
@ -116,6 +118,7 @@ begin
UpdateOptionFromBool(chkAutoIndent.Checked, eoAutoIndent);
UpdateOptionFromBool(chkTabIndent.Checked, eoTabIndent);
UpdateOptionFromBool(chkSmartTabs.Checked, eoSmartTabs);
UpdateOptionFromBool(chkGroupUndo.Checked, eoGroupUndo);
edTabWidth.Text := IntToStr(StrToIntDef(edTabWidth.Text,8));
gEditorSynEditTabWidth := StrToIntDef(edTabWidth.Text,8);
gEditorSynEditBlockIndent := seeBlockIndent.Value;