Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions FastColoredTextBox/FastColoredTextBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,13 @@ public char[] AutoCompleteBracketsList
[Description("AutoComplete brackets.")]
public bool AutoCompleteBrackets { get; set; }

/// <summary>
/// Force inserted string or char to be uppercase
/// </summary>
[DefaultValue(false)]
[Description("Force upper case.")]
public bool ForceUpperCase { get; set; }

/// <summary>
/// Colors of some service visual markers
/// </summary>
Expand Down Expand Up @@ -2729,7 +2736,7 @@ public virtual void InsertText(string text, bool jumpToCaret)
if (Selection.IsEmpty && Selection.Start.iChar > GetLineLength(Selection.Start.iLine) && VirtualSpace)
InsertVirtualSpaces();

lines.Manager.ExecuteCommand(new InsertTextCommand(TextSource, text));
lines.Manager.ExecuteCommand(new InsertTextCommand(TextSource, ForceUpperCase ? text.ToUpper() : text));
if (updating <= 0 && jumpToCaret)
DoCaretVisible();
}
Expand Down Expand Up @@ -2988,7 +2995,7 @@ protected virtual void InsertChar(char c)
InsertVirtualSpaces();

//insert char
lines.Manager.ExecuteCommand(new InsertCharCommand(TextSource, c));
lines.Manager.ExecuteCommand(new InsertCharCommand(TextSource, ForceUpperCase ? char.ToUpper(c) : c));
}
finally
{
Expand Down