-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception is thrown when making a new line #199
Comments
Stacktrace:
|
@AlphaNecron. I tried the demo application and I cannot reproduce it. Could you share a minimal sample that reproduces the issue? I'll try to fix. Thanks in advance |
Can i send the project to your email? |
Well, just share here how you instantiate the Avalonia Text Editor and how you set up TextMate just to help me to reproduce the issue. |
<avaloniaEdit:TextEditor x:Name="MainEditor" Padding="4"
Background="#181818"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto"
FontFamily="avares://Kide/Assets/Fonts#JetBrains Mono"
FontWeight="Normal"
FontSize="13"
Encoding="{Binding EditorEncoding, Mode=TwoWay}"
WordWrap="False" ShowLineNumbers="True">
<avaloniaEdit:TextEditor.Options>
<avaloniaEdit:TextEditorOptions EnableHyperlinks="True" ConvertTabsToSpaces="True" ShowSpaces="True" EnableRectangularSelection="True" HighlightCurrentLine="True"/>
</avaloniaEdit:TextEditor.Options>
<avaloniaEdit:TextEditor.ContextMenu>
<ContextMenu>
<MenuItem Header="Cut">
<MenuItem.Icon>
<PathIcon Width="12" Height="12" Data="{StaticResource CutGeometry}"/>
</MenuItem.Icon>
</MenuItem>
</ContextMenu>
</avaloniaEdit:TextEditor.ContextMenu>
<Interaction.Behaviors>
<behaviors:DocumentTextBindingBehavior Text="{Binding Code, Mode=TwoWay}" />
</Interaction.Behaviors>
</avaloniaEdit:TextEditor> var ropts = new RegistryOptions(ThemeName.DarkPlus);
var editor = this.FindControl<TextEditor>("MainEditor");
editor.TextArea.Caret.PositionChanged += delegate
{
ViewModel!.CaretPos = editor.TextArea.Caret.Position.Location;
};
editor.TextArea.SelectionBrush = new SolidColorBrush
{
Color = Color.FromRgb(38, 78, 119),
Opacity = 0.4
};
editor.TextArea.SelectionCornerRadius = 2;
editor.TextArea.SelectionForeground = new SolidColorBrush
{
Color = Color.FromRgb(248, 250, 251)
};
editor.TextArea.IndentationStrategy = new CSharpIndentationStrategy();
var tm = editor.InstallTextMate(ropts);
tm.SetGrammar(ropts.GetScopeByLanguageId(ropts.GetLanguageByExtension(".pas").Id));
tm.SetTheme(ropts.LoadTheme(ThemeName.DarkPlus)); |
I'm sorry I'm unable to reproduce the issue. Can you reproduce the issue in the "Demo" application? |
I cannot: pascal.mp4 |
https://github.com/AlphaNecron/Kide Here's the repo, you can try and see. |
Reproduced using your sample. I'll provide a fix for it. Note that re-setting the document text here makes editing incredible slow (and that unveiled a sync issue in TextMateSharp). |
It's a part of the MVVM example of |
Is there another way to do this? |
Sorry I'm not familiar with the MVVM sample of avalonia edit. @Takoooooo can you help with this? |
Kide_Ce7fskTPt1.mp4
This happens only when I add
tm.SetGrammar(ropts.GetScopeByLanguageId(ropts.GetLanguageByExtension(".cs").Id));
Is there any solution?
The text was updated successfully, but these errors were encountered: