Skip to content

Commit

Permalink
Merge pull request #44 from danwalmsley/editor-performance
Browse files Browse the repository at this point in the history
Editor performance & Update to Avalonia Beta1 (0.6.0)
  • Loading branch information
danwalmsley authored Feb 18, 2018
2 parents 338ac95 + 7e15fe7 commit eb8b399
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 19 deletions.
2 changes: 1 addition & 1 deletion build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ if (isRunningOnAppVeyor)
}
}

var editbin = @"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\bin\HostX86\x86\editbin.exe";
var editbin = @"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\bin\HostX86\x86\editbin.exe";

///////////////////////////////////////////////////////////////////////////////
// DIRECTORIES
Expand Down
2 changes: 1 addition & 1 deletion src/AvaloniaEdit.Demo/AvaloniaEdit.Demo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="0.5.2-build4199-alpha" />
<PackageReference Include="Avalonia.Desktop" Version="0.6.0" />
</ItemGroup>

<ItemGroup>
Expand Down
13 changes: 10 additions & 3 deletions src/AvaloniaEdit/AvaloniaEdit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Collections.Immutable" Version="1.3.1" />
<PackageReference Include="System.Xml.ReaderWriter" Version="4.3.0" />
<PackageReference Include="Avalonia" Version="0.5.2-build4199-alpha" />
<PackageReference Include="Avalonia" Version="0.6.0" />
<PackageReference Include="System.Collections.Immutable" Version="1.4.0" />
<PackageReference Include="System.Xml.ReaderWriter" Version="4.3.1" />
</ItemGroup>

<Target Name="ChangeAliasesOfSystemDrawing" BeforeTargets="FindReferenceAssembliesForReferences;ResolveReferences">
<ItemGroup>
<ReferencePath Condition="'%(FileName)' == 'Splat'">
<Aliases>SystemDrawing</Aliases>
</ReferencePath>
</ItemGroup>
</Target>
</Project>
2 changes: 1 addition & 1 deletion src/AvaloniaEdit/CodeCompletion/InsightWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
Grid.Column="0"
Margin="0,0,4,0"
Orientation="Horizontal"
IsVisible="{TemplateBinding Path=Provider.Count, Converter={Static cc:CollapseIfSingleOverloadConverter.Instance}}">
IsVisible="{TemplateBinding Path=Provider.Count, Converter={x:Static cc:CollapseIfSingleOverloadConverter.Instance}}">
<Button Name="PART_UP">
<Path Stroke="Black"
Fill="Black"
Expand Down
11 changes: 8 additions & 3 deletions src/AvaloniaEdit/Editing/TextArea.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1024,11 +1024,12 @@ protected override Size ArrangeOverride(Size finalSize)
_viewPort = new Size(finalSize.Width, finalSize.Height / TextView.DefaultLineHeight);
_extent = new Size(finalSize.Width, LogicalScrollSize);

TextView.SetScrollData(new Size(_viewPort.Width, _viewPort.Height * TextView.DefaultLineHeight), _extent);
if(TextView.SetScrollData(new Size(_viewPort.Width, _viewPort.Height * TextView.DefaultLineHeight), _extent))
{
TextView.Redraw();
}

(this as ILogicalScrollable).InvalidateScroll?.Invoke();

TextView.Redraw();
}

return base.ArrangeOverride(finalSize);
Expand Down Expand Up @@ -1091,6 +1092,10 @@ Vector IScrollable.Offset
}

Size IScrollable.Viewport => _viewPort;

public bool CanHorizontallyScroll { get; set; } = false;

public bool CanVerticallyScroll { get; set; } = true;
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions src/AvaloniaEdit/Highlighting/HighlightingColor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace AvaloniaEdit.Highlighting
/// <summary>
/// A highlighting color is a set of font properties and foreground and background color.
/// </summary>
public class HighlightingColor : IFreezable, AvaloniaEdit.Utils.ICloneable, IEquatable<HighlightingColor>
public class HighlightingColor : IFreezable, ICloneable, IEquatable<HighlightingColor>
{
internal static readonly HighlightingColor Empty = FreezableHelper.FreezeAndReturn(new HighlightingColor());

Expand Down Expand Up @@ -207,7 +207,7 @@ public virtual HighlightingColor Clone()
return c;
}

object AvaloniaEdit.Utils.ICloneable.Clone()
object ICloneable.Clone()
{
return Clone();
}
Expand Down
1 change: 1 addition & 0 deletions src/AvaloniaEdit/Highlighting/Resources/Resources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ internal static void RegisterBuiltInHighlightings(HighlightingManager.DefaultHig
".booproj;.build;.xfrm;.targets;.xaml;.xpt;" +
".xft;.map;.wsdl;.disco;.ps1xml;.nuspec").Split(';'),
"XML-Mode.xshd");
hlm.RegisterHighlighting("XAML", new[] { ".xaml", ".paml" }, "XML-Mode.xshd");
hlm.RegisterHighlighting("MarkDown", new[] { ".md" }, "MarkDown-Mode.xshd");
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/AvaloniaEdit/Rendering/TextView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ private void InvalidateMeasure(DispatcherPriority priority)
{
if (_invalidateMeasureOperation == null)
{
_invalidateMeasureOperation = Dispatcher.UIThread.InvokeTaskAsync(
_invalidateMeasureOperation = Dispatcher.UIThread.InvokeAsync(
delegate
{
_invalidateMeasureOperation = null;
Expand Down
1 change: 0 additions & 1 deletion src/AvaloniaEdit/Utils/ExtensionMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
Expand Down
7 changes: 1 addition & 6 deletions src/AvaloniaEdit/Utils/IFreezable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ internal interface IFreezable
/// Freezes this instance.
/// </summary>
void Freeze();
}

internal interface ICloneable
{
object Clone();
}
}

internal static class FreezableHelper
{
Expand Down

0 comments on commit eb8b399

Please sign in to comment.