Skip to content

Commit 4feccb1

Browse files
Merge branch 'master' of github.com:icsharpcode/AvalonEdit into feature/fixes
2 parents 64de0a9 + 3320ce1 commit 4feccb1

222 files changed

Lines changed: 4443 additions & 4445 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,222 @@ root = true
55
indent_style = tab
66
indent_size = 4
77

8+
[*.il]
9+
indent_style = space
10+
indent_size = 2
11+
[*.{yml,yaml}]
12+
indent_style = space
13+
indent_size = 2
814
[*.csproj]
915
indent_style = space
1016
indent_size = 2
17+
[*.config]
18+
indent_style = space
19+
indent_size = 2
20+
[*.nuspec]
21+
indent_style = space
22+
indent_size = 2
23+
[*.vsixmanifest]
24+
indent_style = space
25+
indent_size = 2
26+
[*.vsct]
27+
indent_style = space
28+
indent_size = 2
29+
[*.xaml]
30+
indent_style = tab
31+
indent_size = 4
32+
33+
# C# files
34+
[*.cs]
35+
36+
#### Core EditorConfig Options ####
37+
38+
# Indentation and spacing
39+
indent_size = 4
40+
indent_style = tab
41+
tab_width = 4
42+
43+
# New line preferences
44+
end_of_line = crlf
45+
insert_final_newline = false
46+
47+
#### .NET Coding Conventions ####
48+
49+
# Organize usings
50+
dotnet_separate_import_directive_groups = true
51+
dotnet_sort_system_directives_first = true
52+
53+
# this. and Me. preferences
54+
dotnet_style_qualification_for_event = false:silent
55+
dotnet_style_qualification_for_field = false:silent
56+
dotnet_style_qualification_for_method = false:silent
57+
dotnet_style_qualification_for_property = false:silent
58+
59+
# Language keywords vs BCL types preferences
60+
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
61+
dotnet_style_predefined_type_for_member_access = true:silent
62+
63+
# Parentheses preferences
64+
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
65+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
66+
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
67+
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
68+
69+
# Modifier preferences
70+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
71+
72+
# Expression-level preferences
73+
csharp_style_deconstructed_variable_declaration = true:suggestion
74+
csharp_style_inlined_variable_declaration = true:suggestion
75+
csharp_style_throw_expression = true:suggestion
76+
dotnet_style_coalesce_expression = true:suggestion
77+
dotnet_style_collection_initializer = true:suggestion
78+
dotnet_style_explicit_tuple_names = true:suggestion
79+
dotnet_style_null_propagation = true:suggestion
80+
dotnet_style_object_initializer = true:suggestion
81+
dotnet_style_prefer_auto_properties = true:silent
82+
dotnet_style_prefer_compound_assignment = true:suggestion
83+
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
84+
dotnet_style_prefer_conditional_expression_over_return = true:silent
85+
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
86+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
87+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
88+
89+
# Field preferences
90+
dotnet_style_readonly_field = true:suggestion
91+
92+
# Parameter preferences
93+
dotnet_code_quality_unused_parameters = all:suggestion
94+
95+
#### C# Coding Conventions ####
96+
97+
# var preferences
98+
csharp_style_var_elsewhere = false:silent
99+
csharp_style_var_for_built_in_types = false:silent
100+
csharp_style_var_when_type_is_apparent = false:silent
101+
102+
# Expression-bodied members
103+
csharp_style_expression_bodied_accessors = true:silent
104+
csharp_style_expression_bodied_constructors = false:silent
105+
csharp_style_expression_bodied_indexers = true:silent
106+
csharp_style_expression_bodied_lambdas = true:silent
107+
csharp_style_expression_bodied_local_functions = false:silent
108+
csharp_style_expression_bodied_methods = false:silent
109+
csharp_style_expression_bodied_operators = false:silent
110+
csharp_style_expression_bodied_properties = true:silent
111+
112+
# Pattern matching preferences
113+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
114+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
115+
116+
# Null-checking preferences
117+
csharp_style_conditional_delegate_call = true:suggestion
118+
119+
# Modifier preferences
120+
csharp_prefer_static_local_function = true:suggestion
121+
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async
122+
123+
# Code-block preferences
124+
csharp_prefer_braces = true:silent
125+
csharp_prefer_simple_using_statement = true:suggestion
126+
127+
# Expression-level preferences
128+
csharp_prefer_simple_default_expression = true:suggestion
129+
csharp_style_pattern_local_over_anonymous_function = true:suggestion
130+
csharp_style_prefer_index_operator = true:suggestion
131+
csharp_style_prefer_range_operator = true:suggestion
132+
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
133+
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
134+
135+
# 'using' directive preferences
136+
csharp_using_directive_placement = outside_namespace:silent
137+
138+
#### C# Formatting Rules ####
139+
140+
# New line preferences
141+
csharp_new_line_before_catch = false
142+
csharp_new_line_before_else = false
143+
csharp_new_line_before_finally = false
144+
csharp_new_line_before_members_in_anonymous_types = true
145+
csharp_new_line_before_members_in_object_initializers = true
146+
csharp_new_line_before_open_brace = methods,types
147+
csharp_new_line_between_query_expression_clauses = true
148+
149+
# Indentation preferences
150+
csharp_indent_block_contents = true
151+
csharp_indent_braces = false
152+
csharp_indent_case_contents = true
153+
csharp_indent_case_contents_when_block = false
154+
csharp_indent_labels = one_less_than_current
155+
csharp_indent_switch_labels = true
156+
157+
# Space preferences
158+
csharp_space_after_cast = false
159+
csharp_space_after_colon_in_inheritance_clause = true
160+
csharp_space_after_comma = true
161+
csharp_space_after_dot = false
162+
csharp_space_after_keywords_in_control_flow_statements = true
163+
csharp_space_after_semicolon_in_for_statement = true
164+
csharp_space_around_binary_operators = before_and_after
165+
csharp_space_around_declaration_statements = false
166+
csharp_space_before_colon_in_inheritance_clause = true
167+
csharp_space_before_comma = false
168+
csharp_space_before_dot = false
169+
csharp_space_before_open_square_brackets = false
170+
csharp_space_before_semicolon_in_for_statement = false
171+
csharp_space_between_empty_square_brackets = false
172+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
173+
csharp_space_between_method_call_name_and_opening_parenthesis = false
174+
csharp_space_between_method_call_parameter_list_parentheses = false
175+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
176+
csharp_space_between_method_declaration_name_and_open_parenthesis = false
177+
csharp_space_between_method_declaration_parameter_list_parentheses = false
178+
csharp_space_between_parentheses = false
179+
csharp_space_between_square_brackets = false
180+
181+
# Wrapping preferences
182+
csharp_preserve_single_line_blocks = true
183+
csharp_preserve_single_line_statements = true
184+
185+
#### Naming styles ####
186+
187+
# Naming rules
188+
189+
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
190+
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
191+
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
192+
193+
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
194+
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
195+
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
196+
197+
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
198+
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
199+
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
200+
201+
# Symbol specifications
202+
203+
dotnet_naming_symbols.interface.applicable_kinds = interface
204+
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal
205+
dotnet_naming_symbols.interface.required_modifiers =
206+
207+
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
208+
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal
209+
dotnet_naming_symbols.types.required_modifiers =
210+
211+
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
212+
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal
213+
dotnet_naming_symbols.non_field_members.required_modifiers =
214+
215+
# Naming styles
216+
217+
dotnet_naming_style.pascal_case.required_prefix =
218+
dotnet_naming_style.pascal_case.required_suffix =
219+
dotnet_naming_style.pascal_case.word_separator =
220+
dotnet_naming_style.pascal_case.capitalization = pascal_case
221+
222+
dotnet_naming_style.begins_with_i.required_prefix = I
223+
dotnet_naming_style.begins_with_i.required_suffix =
224+
dotnet_naming_style.begins_with_i.word_separator =
225+
dotnet_naming_style.begins_with_i.capitalization = pascal_case
226+

ICSharpCode.AvalonEdit.Sample/Window1.xaml

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,32 @@
3535
</Style.Triggers>
3636
</Style>
3737
</ToolBar.Resources>
38-
<Button Click="openFileClick"><Image Source="Images/Open.png" Height="16"/></Button>
39-
<Button Click="saveFileClick"><Image Source="Images/Save.png" Height="16"/></Button>
38+
<Button Click="openFileClick">
39+
<Image Source="Images/Open.png" Height="16"/>
40+
</Button>
41+
<Button Click="saveFileClick">
42+
<Image Source="Images/Save.png" Height="16"/>
43+
</Button>
4044
<Separator/>
41-
<Button Command="Cut"><Image Source="Images/Cut.png" Height="16"/></Button>
42-
<Button Command="Copy"><Image Source="Images/Copy.png" Height="16"/></Button>
43-
<Button Command="Paste"><Image Source="Images/Paste.png" Height="16"/></Button>
44-
<Button Command="Delete"><Image Source="Images/Delete.png" Height="16"/></Button>
45-
<Separator/>
46-
<Button Command="Undo"><Image Source="Images/Undo.png" Height="16"/></Button>
47-
<Button Command="Redo"><Image Source="Images/Redo.png" Height="16"/></Button>
45+
<Button Command="Cut">
46+
<Image Source="Images/Cut.png" Height="16"/>
47+
</Button>
48+
<Button Command="Copy">
49+
<Image Source="Images/Copy.png" Height="16"/>
50+
</Button>
51+
<Button Command="Paste">
52+
<Image Source="Images/Paste.png" Height="16"/>
53+
</Button>
54+
<Button Command="Delete">
55+
<Image Source="Images/Delete.png" Height="16"/>
56+
</Button>
57+
<Separator/>
58+
<Button Command="Undo">
59+
<Image Source="Images/Undo.png" Height="16"/>
60+
</Button>
61+
<Button Command="Redo">
62+
<Image Source="Images/Redo.png" Height="16"/>
63+
</Button>
4864
<Separator/>
4965
<CheckBox IsChecked="{Binding ElementName=textEditor,Path=WordWrap}">
5066
<Image Source="Images/WordWrap.png" Height="16"/>

ICSharpCode.AvalonEdit/AvalonEditCommands.cs

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1717
// DEALINGS IN THE SOFTWARE.
1818

19-
using System;
2019
using System.Windows.Input;
2120

2221
namespace ICSharpCode.AvalonEdit
@@ -45,61 +44,61 @@ public static class AvalonEditCommands
4544
new InputGestureCollection {
4645
new KeyGesture(Key.D, ModifierKeys.Control)
4746
});
48-
47+
4948
/// <summary>
5049
/// Removes leading whitespace from the selected lines (or the whole document if the selection is empty).
5150
/// </summary>
5251
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Whitespace",
53-
Justification = "WPF uses 'Whitespace'")]
52+
Justification = "WPF uses 'Whitespace'")]
5453
public static readonly RoutedCommand RemoveLeadingWhitespace = new RoutedCommand("RemoveLeadingWhitespace", typeof(TextEditor));
55-
54+
5655
/// <summary>
5756
/// Removes trailing whitespace from the selected lines (or the whole document if the selection is empty).
5857
/// </summary>
5958
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Whitespace",
60-
Justification = "WPF uses 'Whitespace'")]
59+
Justification = "WPF uses 'Whitespace'")]
6160
public static readonly RoutedCommand RemoveTrailingWhitespace = new RoutedCommand("RemoveTrailingWhitespace", typeof(TextEditor));
62-
61+
6362
/// <summary>
6463
/// Converts the selected text to upper case.
6564
/// </summary>
6665
public static readonly RoutedCommand ConvertToUppercase = new RoutedCommand("ConvertToUppercase", typeof(TextEditor));
67-
66+
6867
/// <summary>
6968
/// Converts the selected text to lower case.
7069
/// </summary>
7170
public static readonly RoutedCommand ConvertToLowercase = new RoutedCommand("ConvertToLowercase", typeof(TextEditor));
72-
71+
7372
/// <summary>
7473
/// Converts the selected text to title case.
7574
/// </summary>
7675
public static readonly RoutedCommand ConvertToTitleCase = new RoutedCommand("ConvertToTitleCase", typeof(TextEditor));
77-
76+
7877
/// <summary>
7978
/// Inverts the case of the selected text.
8079
/// </summary>
8180
public static readonly RoutedCommand InvertCase = new RoutedCommand("InvertCase", typeof(TextEditor));
82-
81+
8382
/// <summary>
8483
/// Converts tabs to spaces in the selected text.
8584
/// </summary>
8685
public static readonly RoutedCommand ConvertTabsToSpaces = new RoutedCommand("ConvertTabsToSpaces", typeof(TextEditor));
87-
86+
8887
/// <summary>
8988
/// Converts spaces to tabs in the selected text.
9089
/// </summary>
9190
public static readonly RoutedCommand ConvertSpacesToTabs = new RoutedCommand("ConvertSpacesToTabs", typeof(TextEditor));
92-
91+
9392
/// <summary>
9493
/// Converts leading tabs to spaces in the selected lines (or the whole document if the selection is empty).
9594
/// </summary>
9695
public static readonly RoutedCommand ConvertLeadingTabsToSpaces = new RoutedCommand("ConvertLeadingTabsToSpaces", typeof(TextEditor));
97-
96+
9897
/// <summary>
9998
/// Converts leading spaces to tabs in the selected lines (or the whole document if the selection is empty).
10099
/// </summary>
101100
public static readonly RoutedCommand ConvertLeadingSpacesToTabs = new RoutedCommand("ConvertLeadingSpacesToTabs", typeof(TextEditor));
102-
101+
103102
/// <summary>
104103
/// Runs the IIndentationStrategy on the selected lines (or the whole document if the selection is empty).
105104
/// </summary>

0 commit comments

Comments
 (0)