Skip to content

Commit

Permalink
Merge pull request #332 from AvaloniaUI/preview7
Browse files Browse the repository at this point in the history
Update to Avalonia 11 preview 8
  • Loading branch information
danipen authored May 10, 2023
2 parents 2109e29 + a008e1b commit 41ed3f1
Show file tree
Hide file tree
Showing 18 changed files with 73 additions and 929 deletions.
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<PropertyGroup>
<LangVersion>latest</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AvaloniaVersion>11.0.0-preview6</AvaloniaVersion>
<TextMateSharpVersion>1.0.52</TextMateSharpVersion>
<AvaloniaVersion>11.0.0-preview8</AvaloniaVersion>
<TextMateSharpVersion>1.0.55</TextMateSharpVersion>
<VersionSuffix>beta</VersionSuffix>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion src/AvaloniaEdit.TextMate/TextEditorModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ private void TokenizeViewPort()
ForceTokenization(
_textView.VisualLines[0].FirstDocumentLine.LineNumber - 1,
_textView.VisualLines[_textView.VisualLines.Count - 1].LastDocumentLine.LineNumber - 1);
}, DispatcherPriority.MinValue);
}, DispatcherPriority.Default);
}

internal class InvalidLineRange
Expand Down
11 changes: 6 additions & 5 deletions src/AvaloniaEdit/Editing/EditingCommandHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
using AvaloniaEdit.Document;
using Avalonia.Input;
using AvaloniaEdit.Utils;
using Avalonia.Controls;

namespace AvaloniaEdit.Editing
{
Expand Down Expand Up @@ -415,17 +416,17 @@ private static bool CopySelectedText(TextArea textArea)
var text = textArea.Selection.GetText();
text = TextUtilities.NormalizeNewLines(text, Environment.NewLine);

SetClipboardText(text);
SetClipboardText(text, textArea);

textArea.OnTextCopied(new TextEventArgs(text));
return true;
}

private static void SetClipboardText(string text)
private static void SetClipboardText(string text, Visual visual)
{
try
{
Application.Current.Clipboard.SetTextAsync(text).GetAwaiter().GetResult();
TopLevel.GetTopLevel(visual)?.Clipboard?.SetTextAsync(text).GetAwaiter().GetResult();
}
catch (Exception)
{
Expand Down Expand Up @@ -470,7 +471,7 @@ private static bool CopyWholeLine(TextArea textArea, DocumentLine line)
//if (copyingEventArgs.CommandCancelled)
// return false;

SetClipboardText(text);
SetClipboardText(text, textArea);

textArea.OnTextCopied(new TextEventArgs(text));
return true;
Expand All @@ -496,7 +497,7 @@ private static async void OnPaste(object target, ExecutedRoutedEventArgs args)
string text = null;
try
{
text = await Application.Current.Clipboard.GetTextAsync();
text = await TopLevel.GetTopLevel(textArea)?.Clipboard?.GetTextAsync();
}
catch (Exception)
{
Expand Down
2 changes: 1 addition & 1 deletion src/AvaloniaEdit/Editing/TextArea.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<DockPanel Focusable="False" Background="{TemplateBinding Background}">
<ItemsControl DockPanel.Dock="Left"
Focusable="False"
Items="{TemplateBinding LeftMargins}">
ItemsSource="{TemplateBinding LeftMargins}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
Expand Down
15 changes: 8 additions & 7 deletions test/AvaloniaEdit.Tests/AvaloniaEdit.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="$(AvaloniaVersion)" />
<PackageReference Include="Avalonia.Themes.Simple" Version="$(AvaloniaVersion)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
<PackageReference Include="Moq" Version="4.10.1" />
<PackageReference Include="NUnit" Version="3.11.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.13.0" />
<PackageReference Include="Avalonia" Version="11.0.999-cibuild0034510-beta" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.999-cibuild0034510-beta" />
<PackageReference Include="Avalonia.Themes.Simple" Version="11.0.999-cibuild0034510-beta" />
<PackageReference Include="Avalonia.Headless.NUnit" Version="11.0.999-cibuild0034510-beta" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2" />
</ItemGroup>

<ItemGroup>
Expand Down
54 changes: 0 additions & 54 deletions test/AvaloniaEdit.Tests/AvaloniaMocks/MockFontManagerImpl.cs

This file was deleted.

36 changes: 0 additions & 36 deletions test/AvaloniaEdit.Tests/AvaloniaMocks/MockGlyphRun.cs

This file was deleted.

81 changes: 0 additions & 81 deletions test/AvaloniaEdit.Tests/AvaloniaMocks/MockGlyphTypeface.cs

This file was deleted.

This file was deleted.

Loading

0 comments on commit 41ed3f1

Please sign in to comment.