Skip to content

Commit

Permalink
Merge pull request #378 from WarPie/master
Browse files Browse the repository at this point in the history
Option to not have caret go past EOL
  • Loading branch information
nielsAD committed Apr 15, 2016
2 parents cf2d0e8 + 680a018 commit dbd48d9
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 76 deletions.
8 changes: 6 additions & 2 deletions Projects/Simba/framescript.pas
Original file line number Diff line number Diff line change
Expand Up @@ -767,10 +767,14 @@ constructor TScriptFrame.Create(TheOwner: TComponent);
OwnerSheet.Caption:= ScriptName;

SynEdit.Enabled := True; // For some reason we need this?

SynEdit.Highlighter := SimbaForm.CurrHighlighter;
SynEdit.Options := SynEdit.Options + [eoTabIndent, eoKeepCaretX, eoDragDropEditing] - [eoSmartTabs];
SynEdit.Options := SynEdit.Options + [eoTabIndent, eoKeepCaretX, eoDragDropEditing, eoScrollPastEof] - [eoSmartTabs];
SynEdit.Options2 := SynEdit.Options2 + [eoCaretSkipsSelection];

if not SimbaSettings.SourceEditor.CaretPastEOL.GetDefValue(True) then
SynEdit.Options := SynEdit.Options - [eoScrollPastEol, eoTrimTrailingSpaces];

SynEdit.Gutter.CodeFoldPart.MarkupInfo.Background:= clWhite;
for i := low(i) to high(i) do
if i in AdditionalFolds then
Expand Down
4 changes: 4 additions & 0 deletions Projects/Simba/newsimbasettings.pas
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ TInterpreterSection = class(TSection)
TSourceEditorSection = class(TSection)
DefScriptPath: TFileSetting;
LazColors: TBooleanSetting;
CaretPastEOL: TBooleanSetting;
Font: TFontSetting;
end;

Expand Down Expand Up @@ -883,6 +884,7 @@ procedure GetScriptManagerFile(obj: TObject); begin TStringSetting(obj).Value :=
procedure GetScriptManagerFirstRun(obj: TObject); begin TBooleanSetting(obj).Value := True; end;

procedure GetSourceEditorLazColors(obj: TObject); begin TBooleanSetting(obj).Value := True; end;
procedure GetSourceEditorCaretPastEOL(obj: TObject); begin TBooleanSetting(obj).Value := True; end;

procedure GetExtensionsFileExtension(obj: TObject); begin TStringSetting(obj).Value := 'sex'; end;

Expand Down Expand Up @@ -969,6 +971,8 @@ constructor TSimbaSettings.Create;
SourceEditor.DefScriptPath.onDefault := @GetDefScriptPath;
SourceEditor.LazColors := SourceEditor.AddChild(TBooleanSetting.Create(ssSourceEditorLazColors)) as TBooleanSetting;
SourceEditor.LazColors.onDefault := @GetSourceEditorLazColors;
SourceEditor.CaretPastEOL := SourceEditor.AddChild(TBooleanSetting.Create(ssSourceEditorCaretPastEOL)) as TBooleanSetting;
SourceEditor.CaretPastEOL.onDefault := @GetSourceEditorCaretPastEOL;
SourceEditor.Font := SourceEditor.AddChild(TFontSetting.Create(ssSourceEditorFont)) as TFontSetting;

News := AddChild(TNewsSection.Create()) as TNewsSection;
Expand Down
1 change: 1 addition & 0 deletions Projects/Simba/settings_const.inc
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ ssCodeCompletionShowAutomatically = ssSettings + ssCodeInsight + 'CodeCompletion
ssShowBalloonHints = ssSettings + 'ShowBalloonHints';

ssSourceEditorLazColors = ssSettings + ssSourceEditor + 'LazColors';
ssSourceEditorCaretPastEOL = ssSettings + ssSourceEditor + 'CaretPastEOL';
ssSourceEditorFont = ssSettings + ssSourceEditor + 'Font/';
ssSourceEditorDefScriptPath = ssSettings + ssSourceEditor + 'DefScriptPath';

Expand Down
112 changes: 64 additions & 48 deletions Projects/Simba/simbasettingssimple.lfm
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
object SettingsSimpleForm: TSettingsSimpleForm
Left = 696
Height = 416
Top = 270
Left = 277
Height = 500
Top = 303
Width = 457
ActiveControl = SettingsTabsPanel
Caption = 'Settings'
ClientHeight = 416
ClientHeight = 500
ClientWidth = 457
Constraints.MaxHeight = 416
Constraints.MaxHeight = 500
Constraints.MaxWidth = 457
Constraints.MinHeight = 416
Constraints.MinHeight = 500
Constraints.MinWidth = 457
OnCreate = FormCreate
OnShow = FormShow
Position = poMainFormCenter
LCLVersion = '0.9.30.4'
LCLVersion = '1.4.0.1'
object PgControlAdvanced: TPageControl
Left = 8
Height = 304
Expand All @@ -28,14 +28,14 @@ object SettingsSimpleForm: TSettingsSimpleForm
Caption = 'Paths'
ChildSizing.TopBottomSpacing = 10
ChildSizing.VerticalSpacing = 10
ClientHeight = 271
ClientWidth = 434
ClientHeight = 276
ClientWidth = 432
object PathsTreeView: TTreeView
Left = 13
Height = 239
Top = 13
Width = 400
DefaultItemHeight = 17
DefaultItemHeight = 18
TabOrder = 0
Items.Data = {
F9FFFFFF020005000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF010000000000
Expand All @@ -57,7 +57,7 @@ object SettingsSimpleForm: TSettingsSimpleForm
object ButtonOK: TButton
Left = 280
Height = 25
Top = 384
Top = 464
Width = 75
Caption = 'OK'
OnClick = ButtonOKClick
Expand All @@ -66,7 +66,7 @@ object SettingsSimpleForm: TSettingsSimpleForm
object ButtonCancel: TButton
Left = 368
Height = 25
Top = 384
Top = 464
Width = 75
Caption = 'Cancel'
OnClick = ButtonCancelClick
Expand Down Expand Up @@ -140,75 +140,75 @@ object SettingsSimpleForm: TSettingsSimpleForm
Caption = 'Updater'
ChildSizing.TopBottomSpacing = 10
ChildSizing.VerticalSpacing = 10
ClientHeight = 271
ClientWidth = 434
ClientHeight = 276
ClientWidth = 432
object UpdaterGroup: TGroupBox
Left = 12
Height = 232
Top = 8
Width = 409
ClientHeight = 228
ClientHeight = 212
ClientWidth = 405
TabOrder = 0
object CheckForUpdatesBox: TCheckBox
Left = 16
Height = 22
Height = 19
Top = 13
Width = 140
Width = 116
Caption = 'Check for updates'
TabOrder = 0
end
object Label1: TLabel
Left = 16
Height = 16
Height = 15
Top = 50
Width = 149
Width = 121
Caption = 'Check every (minutes):'
ParentColor = False
end
object UpdateMinutesEdit: TEdit
Left = 160
Height = 25
Height = 23
Top = 47
Width = 80
TabOrder = 1
end
object UpdaterURL: TEdit
Left = 160
Height = 25
Height = 23
Top = 80
Width = 240
TabOrder = 2
end
object UpdaterURLVersion: TEdit
Left = 160
Height = 25
Height = 23
Top = 110
Width = 240
TabOrder = 3
Text = 'UpdaterURLVersion'
end
object UpdaterURLLabel: TLabel
Left = 16
Height = 16
Height = 15
Top = 85
Width = 82
Width = 66
Caption = 'Updater URL'
ParentColor = False
end
object UpdaterURLVersionLabel: TLabel
Left = 16
Height = 16
Height = 15
Top = 115
Width = 133
Width = 108
Caption = 'Updater Version URL'
ParentColor = False
end
object AutomaticallyUpdateBox: TCheckBox
Left = 16
Height = 22
Height = 19
Top = 144
Width = 167
Width = 139
Caption = 'Automatically update?'
TabOrder = 4
end
Expand All @@ -232,7 +232,7 @@ object SettingsSimpleForm: TSettingsSimpleForm
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 88
ClientHeight = 72
ClientWidth = 404
Items.Strings = (
'PascalScript'
Expand All @@ -244,17 +244,17 @@ object SettingsSimpleForm: TSettingsSimpleForm
end
object PgControlEnvironment: TPageControl
Left = 8
Height = 304
Height = 384
Top = 72
Width = 440
ActivePage = tsTabs
TabIndex = 0
ActivePage = tsEditor
TabIndex = 1
TabOrder = 3
Visible = False
object tsTabs: TTabSheet
Caption = 'Tabs'
ClientHeight = 271
ClientWidth = 434
ClientHeight = 356
ClientWidth = 432
object TabSettingsCheckBoxes: TCheckGroup
Left = 12
Height = 167
Expand All @@ -270,6 +270,8 @@ object SettingsSimpleForm: TSettingsSimpleForm
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 147
ClientWidth = 399
Items.Strings = (
'Open Next on Close'
'Open Script in new Tab'
Expand All @@ -283,8 +285,8 @@ object SettingsSimpleForm: TSettingsSimpleForm
end
object tsEditor: TTabSheet
Caption = 'Editor'
ClientHeight = 271
ClientWidth = 434
ClientHeight = 356
ClientWidth = 432
object CodeToolsCheckBoxes: TCheckGroup
Left = 13
Height = 71
Expand All @@ -300,6 +302,8 @@ object SettingsSimpleForm: TSettingsSimpleForm
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 51
ClientWidth = 399
Items.Strings = (
'Automatically show hints'
'Automatically show completion'
Expand All @@ -324,6 +328,8 @@ object SettingsSimpleForm: TSettingsSimpleForm
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 51
ClientWidth = 399
Items.Strings = (
'Show history on pick'
'Add to history on pick'
Expand All @@ -335,43 +341,51 @@ object SettingsSimpleForm: TSettingsSimpleForm
end
object GroupBox2: TGroupBox
Left = 12
Height = 84
Height = 108
Top = 180
Width = 403
Caption = 'Source Editor'
ClientHeight = 67
ClientHeight = 88
ClientWidth = 399
TabOrder = 2
object HighlightLazColours: TCheckBox
Left = 14
Height = 22
Height = 19
Top = 8
Width = 145
Width = 116
Caption = 'Use Lazarus colors'
TabOrder = 0
end
object Label2: TLabel
Left = 14
Height = 16
Top = 32
Width = 90
Height = 15
Top = 60
Width = 73
Caption = 'Default script:'
ParentColor = False
end
object DefaultScriptedit: TEdit
Left = 110
Height = 25
Top = 28
Height = 23
Top = 56
Width = 184
TabOrder = 1
Text = 'path'
end
object CaretPastEOL: TCheckBox
Left = 14
Height = 19
Top = 32
Width = 97
Caption = 'Caret past EOL'
TabOrder = 2
end
end
end
object tsOther: TTabSheet
Caption = 'Other'
ClientHeight = 271
ClientWidth = 434
ClientHeight = 356
ClientWidth = 432
object EnvOther: TCheckGroup
Left = 13
Height = 166
Expand All @@ -386,6 +400,8 @@ object SettingsSimpleForm: TSettingsSimpleForm
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 146
ClientWidth = 398
Items.Strings = (
'Tray always Visible'
'Show Function List on Start'
Expand All @@ -407,7 +423,7 @@ object SettingsSimpleForm: TSettingsSimpleForm
Masked = True
Width = 32
left = 32
top = 369
top = 456
Bitmap = {
4C69050000002000000020000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
Expand Down
Loading

0 comments on commit dbd48d9

Please sign in to comment.