Skip to content

Commit

Permalink
v3.0.0.46 - Fix missed check in previous commit for Tagger crashing
Browse files Browse the repository at this point in the history
  • Loading branch information
e621-ReBot committed Nov 29, 2024
1 parent 0be5287 commit e668fb2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions e621 ReBot v3/Windows/Window_Tagger.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -269,22 +269,22 @@ private void Tags_TextBox_PreviewKeyDown(object sender, KeyEventArgs e)
{
List<string> PasteTags = ((string)Clipboard.GetDataObject().GetData(DataFormats.StringFormat)).ToLower().Replace(Environment.NewLine, "").Split(' ', StringSplitOptions.RemoveEmptyEntries).Distinct().ToList();

if (PasteTags.Count == 1 && Tags_TextBox.Text.Substring(Tags_TextBox.SelectionStart - 1).Equals(":"))
if (PasteTags.Count == 1 && Tags_TextBox.SelectionStart > 0 && Tags_TextBox.Text.Substring(Tags_TextBox.SelectionStart - 1).Equals(":"))
{
Tags_TextBox.Text += $"{string.Join(' ', PasteTags)} ";
}
else
{
List<string> SortTags = Tags_TextBox.Text.Split(' ', StringSplitOptions.RemoveEmptyEntries).Distinct().ToList();
List<string> textBoxTags = Tags_TextBox.Text.Split(' ', StringSplitOptions.RemoveEmptyEntries).Distinct().ToList();
for (int i = PasteTags.Count - 1; i >= 0; i--)
{
if (SortTags.Contains(PasteTags[i]))
if (textBoxTags.Contains(PasteTags[i]))
{
PasteTags.RemoveAt(i);
}
}
SortTags.AddRange(PasteTags);
Tags_TextBox.Text = $"{string.Join(' ', SortTags)} ";
textBoxTags.AddRange(PasteTags);
Tags_TextBox.Text = $"{string.Join(' ', textBoxTags)} ";
}
Tags_TextBox.SelectionStart = Tags_TextBox.Text.Length;
CountTags();
Expand Down
2 changes: 1 addition & 1 deletion e621 ReBot v3/e621 ReBot v3.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<ApplicationIcon>Resources\ReBot_Icon.ico</ApplicationIcon>
<Platforms>x64</Platforms>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<FileVersion>3.0.0.45</FileVersion>
<FileVersion>3.0.0.46</FileVersion>
<StartupObject>e621_ReBot_v3.App</StartupObject>
<IsPublishable>False</IsPublishable>
<RepositoryUrl>https://github.com/e621-ReBot/e621-ReBot-v3</RepositoryUrl>
Expand Down

0 comments on commit e668fb2

Please sign in to comment.