diff --git a/Externals/ICSharpCode.TextEditor b/Externals/ICSharpCode.TextEditor index cd35e8dfde9..4e41ab6a5b3 160000 --- a/Externals/ICSharpCode.TextEditor +++ b/Externals/ICSharpCode.TextEditor @@ -1 +1 @@ -Subproject commit cd35e8dfde980fdcecaff0c41c54880f47c4b352 +Subproject commit 4e41ab6a5b31b906676a22e59c6e4e9ba9db4217 diff --git a/GitCommands/Settings/AppSettings.cs b/GitCommands/Settings/AppSettings.cs index 7afe7a8ffbd..d9bf39ef203 100644 --- a/GitCommands/Settings/AppSettings.cs +++ b/GitCommands/Settings/AppSettings.cs @@ -1473,6 +1473,12 @@ public static Font ConEmuConsoleFont set => SetFont("conemuconsolefont", value); } + public static bool ShowEolMarkerAsGlyph + { + get => GetBool("ShowEolMarkerAsGlyph", false); + set => SetBool("ShowEolMarkerAsGlyph", value); + } + #endregion public static bool MulticolorBranches diff --git a/GitUI/CommandsDialogs/FormSettings.cs b/GitUI/CommandsDialogs/FormSettings.cs index 52c2eb6806a..4cbaf0f4bc1 100644 --- a/GitUI/CommandsDialogs/FormSettings.cs +++ b/GitUI/CommandsDialogs/FormSettings.cs @@ -282,6 +282,8 @@ private void FormSettings_Shown(object sender, EventArgs e) } settingsTreeView.GotoPage(_initialPage); + + settingsTreeView.Focus(); } } diff --git a/GitUI/CommandsDialogs/SettingsDialog/Pages/AppearanceFontsSettingsPage.Designer.cs b/GitUI/CommandsDialogs/SettingsDialog/Pages/AppearanceFontsSettingsPage.Designer.cs index b84a56f0646..c693ed0a9b1 100644 --- a/GitUI/CommandsDialogs/SettingsDialog/Pages/AppearanceFontsSettingsPage.Designer.cs +++ b/GitUI/CommandsDialogs/SettingsDialog/Pages/AppearanceFontsSettingsPage.Designer.cs @@ -34,6 +34,7 @@ private void InitializeComponent() this.monospaceFontChangeButton = new System.Windows.Forms.Button(); this.commitFontChangeButton = new System.Windows.Forms.Button(); this.diffFontChangeButton = new System.Windows.Forms.Button(); + this.ShowEolMarkerAsGlyph = new System.Windows.Forms.CheckBox(); this.applicationFontChangeButton = new System.Windows.Forms.Button(); this.label36 = new System.Windows.Forms.Label(); this.label34 = new System.Windows.Forms.Label(); @@ -58,7 +59,7 @@ private void InitializeComponent() this.gbFonts.Size = new System.Drawing.Size(2132, 117); this.gbFonts.TabIndex = 2; this.gbFonts.TabStop = false; - this.gbFonts.Text = "Fonts"; + this.gbFonts.Text = "Fonts (restart required)"; // // tableLayoutPanel1 // @@ -69,13 +70,14 @@ private void InitializeComponent() this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel1.Controls.Add(this.label56, 0, 0); - this.tableLayoutPanel1.Controls.Add(this.monospaceFontChangeButton, 1, 3); - this.tableLayoutPanel1.Controls.Add(this.commitFontChangeButton, 1, 2); this.tableLayoutPanel1.Controls.Add(this.diffFontChangeButton, 1, 0); + this.tableLayoutPanel1.Controls.Add(this.ShowEolMarkerAsGlyph, 2, 0); + this.tableLayoutPanel1.Controls.Add(this.label26, 0, 1); this.tableLayoutPanel1.Controls.Add(this.applicationFontChangeButton, 1, 1); - this.tableLayoutPanel1.Controls.Add(this.label36, 0, 3); this.tableLayoutPanel1.Controls.Add(this.label34, 0, 2); - this.tableLayoutPanel1.Controls.Add(this.label26, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.commitFontChangeButton, 1, 2); + this.tableLayoutPanel1.Controls.Add(this.label36, 0, 3); + this.tableLayoutPanel1.Controls.Add(this.monospaceFontChangeButton, 1, 3); this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel1.Location = new System.Drawing.Point(8, 22); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; @@ -123,6 +125,18 @@ private void InitializeComponent() this.diffFontChangeButton.UseVisualStyleBackColor = true; this.diffFontChangeButton.Click += new System.EventHandler(this.diffFontChangeButton_Click); // + // ShowEolMarkersAsGlyph + // + this.ShowEolMarkerAsGlyph.AutoSize = true; + this.ShowEolMarkerAsGlyph.Dock = System.Windows.Forms.DockStyle.Fill; + this.ShowEolMarkerAsGlyph.Location = new System.Drawing.Point(181, 3); + this.ShowEolMarkerAsGlyph.Name = "ShowEolMarkerAsGlyph"; + this.ShowEolMarkerAsGlyph.Padding = new System.Windows.Forms.Padding(8, 2, 0, 0); + this.ShowEolMarkerAsGlyph.Size = new System.Drawing.Size(1336, 25); + this.ShowEolMarkerAsGlyph.TabIndex = 5; + this.ShowEolMarkerAsGlyph.Text = "Show end-of-line markers as glyph instead of \"\\r\\n\" etc."; + this.ShowEolMarkerAsGlyph.UseVisualStyleBackColor = true; + // // applicationFontChangeButton // this.applicationFontChangeButton.AutoSize = true; @@ -236,5 +250,6 @@ private void InitializeComponent() private System.Windows.Forms.FontDialog monospaceFontDialog; private System.Windows.Forms.FontDialog commitFontDialog; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private CheckBox ShowEolMarkerAsGlyph; } } diff --git a/GitUI/CommandsDialogs/SettingsDialog/Pages/AppearanceFontsSettingsPage.cs b/GitUI/CommandsDialogs/SettingsDialog/Pages/AppearanceFontsSettingsPage.cs index 089937aec2d..793b48417c9 100644 --- a/GitUI/CommandsDialogs/SettingsDialog/Pages/AppearanceFontsSettingsPage.cs +++ b/GitUI/CommandsDialogs/SettingsDialog/Pages/AppearanceFontsSettingsPage.cs @@ -24,6 +24,8 @@ protected override void SettingsToPage() SetCurrentCommitFont(AppSettings.CommitFont); SetCurrentMonospaceFont(AppSettings.MonospaceFont); + ShowEolMarkerAsGlyph.Checked = AppSettings.ShowEolMarkerAsGlyph; + base.SettingsToPage(); } @@ -39,6 +41,8 @@ protected override void PageToSettings() AppSettings.CommitFont = _commitFont; AppSettings.MonospaceFont = _monospaceFont; + AppSettings.ShowEolMarkerAsGlyph = ShowEolMarkerAsGlyph.Checked; + base.PageToSettings(); } diff --git a/GitUI/CommandsDialogs/SettingsDialog/Pages/AppearanceFontsSettingsPage.resx b/GitUI/CommandsDialogs/SettingsDialog/Pages/AppearanceFontsSettingsPage.resx index 64054fd1dab..729b66b103e 100644 --- a/GitUI/CommandsDialogs/SettingsDialog/Pages/AppearanceFontsSettingsPage.resx +++ b/GitUI/CommandsDialogs/SettingsDialog/Pages/AppearanceFontsSettingsPage.resx @@ -1,64 +1,4 @@ - - - + @@ -118,12 +58,15 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - 196, 17 + 345, 17 - 346, 17 + 474, 17 - + 17, 17 + + 192, 17 + \ No newline at end of file diff --git a/GitUI/Editor/FileViewer.Designer.cs b/GitUI/Editor/FileViewer.Designer.cs index 219c5d0932c..db37068d882 100644 --- a/GitUI/Editor/FileViewer.Designer.cs +++ b/GitUI/Editor/FileViewer.Designer.cs @@ -414,7 +414,7 @@ private void InitializeComponent() this.internalFileViewer.Margin = new System.Windows.Forms.Padding(0); this.internalFileViewer.Name = "internalFileViewer"; this.internalFileViewer.VScrollPosition = 0; - this.internalFileViewer.ShowEOLMarkers = false; + this.internalFileViewer.EolMarkerStyle = ICSharpCode.TextEditor.Document.EolMarkerStyle.None; this.internalFileViewer.ShowSpaces = false; this.internalFileViewer.ShowTabs = false; this.internalFileViewer.Size = new System.Drawing.Size(757, 518); diff --git a/GitUI/Editor/FileViewer.cs b/GitUI/Editor/FileViewer.cs index 25a5abcd9ed..fa1e521e946 100644 --- a/GitUI/Editor/FileViewer.cs +++ b/GitUI/Editor/FileViewer.cs @@ -1191,7 +1191,11 @@ private void SetStateOfContextLinesButtons() private void ToggleNonPrintingChars(bool show) { - internalFileViewer.ShowEOLMarkers = show; + internalFileViewer.EolMarkerStyle = show + ? AppSettings.ShowEolMarkerAsGlyph + ? ICSharpCode.TextEditor.Document.EolMarkerStyle.Glyph + : ICSharpCode.TextEditor.Document.EolMarkerStyle.Text + : ICSharpCode.TextEditor.Document.EolMarkerStyle.None; internalFileViewer.ShowSpaces = show; internalFileViewer.ShowTabs = show; } diff --git a/GitUI/Editor/FileViewerInternal.cs b/GitUI/Editor/FileViewerInternal.cs index c7669e4f0c8..31baf361064 100644 --- a/GitUI/Editor/FileViewerInternal.cs +++ b/GitUI/Editor/FileViewerInternal.cs @@ -399,10 +399,10 @@ public int VScrollPosition } } - public bool ShowEOLMarkers + public EolMarkerStyle EolMarkerStyle { - get => TextEditor.ShowEOLMarkers; - set => TextEditor.ShowEOLMarkers = value; + get => TextEditor.EolMarkerStyle; + set => TextEditor.EolMarkerStyle = value; } public bool ShowSpaces diff --git a/GitUI/Editor/IFileViewer.cs b/GitUI/Editor/IFileViewer.cs index 05b35995ff9..84522509a50 100644 --- a/GitUI/Editor/IFileViewer.cs +++ b/GitUI/Editor/IFileViewer.cs @@ -1,4 +1,6 @@ -namespace GitUI.Editor +using ICSharpCode.TextEditor.Document; + +namespace GitUI.Editor { public class SelectedLineEventArgs : EventArgs { @@ -42,7 +44,7 @@ public interface IFileViewer int VScrollPosition { get; set; } bool? ShowLineNumbers { get; set; } - bool ShowEOLMarkers { get; set; } + EolMarkerStyle EolMarkerStyle { get; set; } bool ShowSpaces { get; set; } bool ShowTabs { get; set; } int VRulerPosition { get; set; } diff --git a/GitUI/Translation/English.xlf b/GitUI/Translation/English.xlf index e6dd24b42b9..b5a58b9fe0e 100644 --- a/GitUI/Translation/English.xlf +++ b/GitUI/Translation/English.xlf @@ -85,6 +85,10 @@ This action will be performed without warning while checking out branch.Fonts + + Show end-of-line markers as glyph instead of "\r\n" etc. + + font name @@ -98,7 +102,7 @@ This action will be performed without warning while checking out branch. - Fonts + Fonts (restart required)