|
5 | 5 | using System.Globalization;
|
6 | 6 | using System.IO;
|
7 | 7 | using System.Linq;
|
| 8 | +using System.Security.Cryptography; |
8 | 9 | using System.Text;
|
9 | 10 | using System.Text.RegularExpressions;
|
10 | 11 | using System.Threading;
|
@@ -46,6 +47,7 @@ public partial class EditTextWindow : Wpf.Ui.Controls.FluentWindow
|
46 | 47 | public static RoutedCommand ReplaceReservedCmd = new();
|
47 | 48 | public static RoutedCommand SingleLineCmd = new();
|
48 | 49 | public static RoutedCommand SplitOnSelectionCmd = new();
|
| 50 | + public static RoutedCommand SplitAfterSelectionCmd = new(); |
49 | 51 | public static RoutedCommand ToggleCaseCmd = new();
|
50 | 52 | public static RoutedCommand UnstackCmd = new();
|
51 | 53 | public static RoutedCommand UnstackGroupCmd = new();
|
@@ -1894,6 +1896,23 @@ private void SplitOnSelectionCmdExecuted(object sender, ExecutedRoutedEventArgs
|
1894 | 1896 | PassedTextControl.Text = textToManipulate.ToString();
|
1895 | 1897 | }
|
1896 | 1898 |
|
| 1899 | + private void SplitAfterSelectionCmdExecuted(object sender, ExecutedRoutedEventArgs e) |
| 1900 | + { |
| 1901 | + string selectedText = PassedTextControl.SelectedText; |
| 1902 | + |
| 1903 | + if (string.IsNullOrEmpty(selectedText)) |
| 1904 | + { |
| 1905 | + System.Windows.MessageBox.Show("No text selected", "Did not split lines"); |
| 1906 | + return; |
| 1907 | + } |
| 1908 | + |
| 1909 | + StringBuilder textToManipulate = new(PassedTextControl.Text); |
| 1910 | + |
| 1911 | + textToManipulate = textToManipulate.Replace(selectedText, selectedText + Environment.NewLine); |
| 1912 | + |
| 1913 | + PassedTextControl.Text = textToManipulate.ToString(); |
| 1914 | + } |
| 1915 | + |
1897 | 1916 | private void ToggleCase(object? sender = null, ExecutedRoutedEventArgs? e = null)
|
1898 | 1917 | {
|
1899 | 1918 | string textToModify = GetSelectedTextOrAllText();
|
|
0 commit comments