diff options
Diffstat (limited to 'main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels')
9 files changed, 31 insertions, 28 deletions
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs index ccf1be8f63..0d4d9dfe23 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs @@ -27,6 +27,7 @@ using System; using MonoDevelop.Core; using MonoDevelop.Ide.Gui.Dialogs; using Mono.TextEditor; +using MonoDevelop.Ide.Editor; namespace MonoDevelop.SourceEditor.OptionPanels { @@ -53,7 +54,7 @@ namespace MonoDevelop.SourceEditor.OptionPanels smartSemicolonPlaceCheckbutton.Active = DefaultSourceEditorOptions.Instance.SmartSemicolonPlacement; tabAsReindentCheckbutton.Active = DefaultSourceEditorOptions.Instance.TabIsReindent; - indentationCombobox.Active = (int)DefaultSourceEditorOptions.Instance.IndentStyle; + indentationCombobox.Active = Math.Min (2, (int)DefaultSourceEditorOptions.Instance.IndentStyle); controlLeftRightCombobox.Active = (int)DefaultSourceEditorOptions.Instance.WordNavigationStyle; useViModesCheck.Active = DefaultSourceEditorOptions.Instance.UseViModes; checkbuttonOnTheFlyFormatting.Active = DefaultSourceEditorOptions.Instance.OnTheFlyFormatting; @@ -76,7 +77,7 @@ namespace MonoDevelop.SourceEditor.OptionPanels //DefaultSourceEditorOptions.Options.AutoInsertTemplates = this.autoInsertTemplateCheckbutton.Active; DefaultSourceEditorOptions.Instance.AutoInsertMatchingBracket = autoInsertBraceCheckbutton.Active; DefaultSourceEditorOptions.Instance.SmartSemicolonPlacement = smartSemicolonPlaceCheckbutton.Active; - DefaultSourceEditorOptions.Instance.IndentStyle = (IndentStyle)indentationCombobox.Active; + DefaultSourceEditorOptions.Instance.IndentStyle = (MonoDevelop.Ide.Editor.IndentStyle)indentationCombobox.Active; DefaultSourceEditorOptions.Instance.TabIsReindent = tabAsReindentCheckbutton.Active; DefaultSourceEditorOptions.Instance.WordNavigationStyle = (WordNavigationStyle)controlLeftRightCombobox.Active; DefaultSourceEditorOptions.Instance.UseViModes = useViModesCheck.Active; diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/ColorShemeEditor.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/ColorShemeEditor.cs index 889f8aa7a7..32ec419c67 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/ColorShemeEditor.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/ColorShemeEditor.cs @@ -29,14 +29,15 @@ using Mono.TextEditor.Highlighting; using MonoDevelop.Core; using MonoDevelop.Ide; using Gtk; +using MonoDevelop.Components; namespace MonoDevelop.SourceEditor.OptionPanels { public partial class ColorShemeEditor : Gtk.Dialog { - TextEditor textEditor; + MonoTextEditor textEditor; ColorScheme colorSheme; - TreeStore colorStore = new Gtk.TreeStore (typeof (string), typeof(ColorScheme.PropertyDecsription), typeof(object)); + TreeStore colorStore = new Gtk.TreeStore (typeof (string), typeof(ColorScheme.PropertyDescription), typeof(object)); string fileName; HighlightingPanel panel; @@ -44,8 +45,8 @@ namespace MonoDevelop.SourceEditor.OptionPanels { this.panel = panel; this.Build (); - textEditor = new TextEditor (); - textEditor.Options = DefaultSourceEditorOptions.Instance; + textEditor = new MonoTextEditor (); + textEditor.Options = new StyledSourceEditorOptions (MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance); this.scrolledwindowTextEditor.Child = textEditor; textEditor.ShowAll (); @@ -70,7 +71,7 @@ namespace MonoDevelop.SourceEditor.OptionPanels void SyntaxCellRenderer (Gtk.CellLayout cell_layout, Gtk.CellRenderer cell, Gtk.TreeModel tree_model, Gtk.TreeIter iter) { var renderer = (Gtk.CellRendererText)cell; - var data = (ColorScheme.PropertyDecsription)colorStore.GetValue (iter, 1); + var data = (ColorScheme.PropertyDescription)colorStore.GetValue (iter, 1); string markup = GLib.Markup.EscapeText (data.Attribute.Name); renderer.Markup = markup; } @@ -83,7 +84,7 @@ namespace MonoDevelop.SourceEditor.OptionPanels Gtk.TreeIter iter; if (colorStore.GetIterFirst (out iter)) { do { - var data = (ColorScheme.PropertyDecsription)colorStore.GetValue (iter, 1); + var data = (ColorScheme.PropertyDescription)colorStore.GetValue (iter, 1); var style = colorStore.GetValue (iter, 2); data.Info.SetValue (sheme, style, null); } while (colorStore.IterNext (ref iter)); @@ -97,8 +98,8 @@ namespace MonoDevelop.SourceEditor.OptionPanels if (editor == null) continue; doc.UpdateParseDocument (); - editor.Parent.TextViewMargin.PurgeLayoutCache (); - editor.Document.CommitUpdateAll (); +// editor.Parent.TextViewMargin.PurgeLayoutCache (); +// editor.Document.CommitUpdateAll (); } } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionAppearancePanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionAppearancePanel.cs index c51e0406d2..6db697e4d4 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionAppearancePanel.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionAppearancePanel.cs @@ -26,6 +26,7 @@ using System; using MonoDevelop.Ide.Gui.Dialogs; using MonoDevelop.Ide.Gui.Content; +using MonoDevelop.Ide.Editor.Extension; namespace MonoDevelop.SourceEditor.OptionPanels { @@ -52,7 +53,6 @@ namespace MonoDevelop.SourceEditor.OptionPanels Gtk.Widget IOptionsPanel.CreatePanelWidget () { - spinbutton1.Value = CompletionTextEditorExtension.CompletionListRows; filterByBrowsableCheckbutton.Active = CompletionTextEditorExtension.FilterCompletionListByEditorBrowsable; normalOnlyRadiobutton.Active = !CompletionTextEditorExtension.IncludeEditorBrowsableAdvancedMembers; includeAdvancedRadiobutton.Active = CompletionTextEditorExtension.IncludeEditorBrowsableAdvancedMembers; @@ -72,7 +72,6 @@ namespace MonoDevelop.SourceEditor.OptionPanels void IOptionsPanel.ApplyChanges () { - CompletionTextEditorExtension.CompletionListRows.Value = spinbutton1.ValueAsInt; CompletionTextEditorExtension.FilterCompletionListByEditorBrowsable.Value = filterByBrowsableCheckbutton.Active; CompletionTextEditorExtension.IncludeEditorBrowsableAdvancedMembers.Value = includeAdvancedRadiobutton.Active; } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionCharactersPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionCharactersPanel.cs index 175d8528ed..83f4b36617 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionCharactersPanel.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionCharactersPanel.cs @@ -32,7 +32,7 @@ using System.Collections.Generic; namespace MonoDevelop.SourceEditor.OptionPanels { - public class CompletionCharactersPanel : VBox, IOptionsPanel + class CompletionCharactersPanel : VBox, IOptionsPanel { ListView list; ListStore store; diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionOptionsPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionOptionsPanel.cs index 5586c8edf8..ef5b6d050f 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionOptionsPanel.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionOptionsPanel.cs @@ -26,6 +26,8 @@ using System; using MonoDevelop.Ide.Gui.Dialogs; using MonoDevelop.Ide.Gui.Content; +using MonoDevelop.Ide.Editor.Extension; +using MonoDevelop.Ide.Editor; namespace MonoDevelop.SourceEditor.OptionPanels { diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs index 17a3c6a6cc..9763ea2637 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs @@ -26,7 +26,8 @@ using System; using MonoDevelop.Ide.Gui.Dialogs; using MonoDevelop.Core; -using MonoDevelop.Ide.Gui.Content; +using MonoDevelop.Ide.Gui.Content; +using MonoDevelop.Ide.Editor; namespace MonoDevelop.SourceEditor.OptionPanels { @@ -58,7 +59,7 @@ namespace MonoDevelop.SourceEditor.OptionPanels { DefaultSourceEditorOptions.Instance.DefaultRegionsFolding = this.foldregionsCheckbutton.Active; DefaultSourceEditorOptions.Instance.DefaultCommentFolding = this.foldCommentsCheckbutton.Active; - DefaultSourceEditorOptions.Instance.LineEndingConversion = (LineEndingConversion)this.comboboxLineEndings.Active; + DefaultSourceEditorOptions.Instance.LineEndingConversion = (MonoDevelop.Ide.Editor.LineEndingConversion)this.comboboxLineEndings.Active; if (DefaultSourceEditorOptions.Instance.ShowFoldMargin != this.foldingCheckbutton.Active) { DefaultSourceEditorOptions.Instance.ShowFoldMargin = this.foldingCheckbutton.Active; HighlightingPanel.UpdateActiveDocument (); diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs index 350d80757c..d4f0847a22 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs @@ -32,6 +32,7 @@ using MonoDevelop.Components; using MonoDevelop.Core; using MonoDevelop.Ide; using MonoDevelop.Ide.Gui.Dialogs; +using MonoDevelop.Ide.Editor; namespace MonoDevelop.SourceEditor.OptionPanels { @@ -47,8 +48,6 @@ namespace MonoDevelop.SourceEditor.OptionPanels this.Build (); styleTreeview.AppendColumn ("", new CellRendererText (), "markup", 0); styleTreeview.Model = styleStore; - // ensure that custom styles are loaded. - new SourceEditorDisplayBinding (); schemeName = DefaultSourceEditorOptions.Instance.ColorScheme; } @@ -167,8 +166,8 @@ namespace MonoDevelop.SourceEditor.OptionPanels var sheme = (ColorScheme)this.styleStore.GetValue (selectedIter, 1); string fileName = sheme.FileName; - - if (fileName != null && fileName.StartsWith (SourceEditorDisplayBinding.SyntaxModePath, StringComparison.Ordinal)) { + + if (fileName != null && fileName.StartsWith (MonoDevelop.Ide.Editor.TextEditorDisplayBinding.SyntaxModePath, StringComparison.Ordinal)) { Mono.TextEditor.Highlighting.SyntaxModeService.Remove (sheme); File.Delete (fileName); ShowStyles (); @@ -204,7 +203,7 @@ namespace MonoDevelop.SourceEditor.OptionPanels if (!dialog.Run ()) return; - string newFileName = SourceEditorDisplayBinding.SyntaxModePath.Combine (dialog.SelectedFile.FileName); + string newFileName = MonoDevelop.Ide.Editor.TextEditorDisplayBinding.SyntaxModePath.Combine (dialog.SelectedFile.FileName); bool success = true; try { @@ -214,7 +213,7 @@ namespace MonoDevelop.SourceEditor.OptionPanels LoggingService.LogError ("Can't copy syntax mode file.", e); } if (success) { - SourceEditorDisplayBinding.LoadCustomStylesAndModes (); + MonoDevelop.Ide.Editor.TextEditorDisplayBinding.LoadCustomStylesAndModes (); ShowStyles (); } } @@ -227,11 +226,11 @@ namespace MonoDevelop.SourceEditor.OptionPanels { if (IdeApp.Workbench.ActiveDocument != null) { IdeApp.Workbench.ActiveDocument.UpdateParseDocument (); - var editor = IdeApp.Workbench.ActiveDocument.Editor; - if (editor != null) { - editor.Parent.TextViewMargin.PurgeLayoutCache (); - editor.Parent.QueueDraw (); - } +// var editor = IdeApp.Workbench.ActiveDocument.Editor; +// if (editor != null) { +// editor.Parent.TextViewMargin.PurgeLayoutCache (); +// editor.Parent.QueueDraw (); +// } } } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/MarkerPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/MarkerPanel.cs index f983b9f003..ced732ecbc 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/MarkerPanel.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/MarkerPanel.cs @@ -26,7 +26,7 @@ using System; using MonoDevelop.Ide.Gui.Dialogs; using MonoDevelop.Core; -using Mono.TextEditor; +using MonoDevelop.Ide.Editor; using MonoDevelop.Ide; namespace MonoDevelop.SourceEditor.OptionPanels diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/NewColorShemeDialog.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/NewColorShemeDialog.cs index f4b3975f73..d5f965d4fb 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/NewColorShemeDialog.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/NewColorShemeDialog.cs @@ -68,7 +68,7 @@ namespace MonoDevelop.SourceEditor.OptionPanels style.Name = this.entryName.Text; style.Description = this.entryDescription.Text; style.BaseScheme = name; - string path = SourceEditorDisplayBinding.SyntaxModePath; + string path = MonoDevelop.Ide.Editor.TextEditorDisplayBinding.SyntaxModePath; string baseName = style.Name.Replace (" ", "_"); while (File.Exists (System.IO.Path.Combine (path, baseName + "Style.json"))) { |