Hi, I have a problem with using SyntaxEditor.
There are two errors when using Korean.
1. When I enter Korean, the caret is shown to the left of the position to be entered. (See line 19 in the Attached File 1)
To add a description of the attached file1, it was a situation in which "가나다라마바사아자차카타파하" was entered in the order, and "하" is the last letter entered, but it can be showed that "하" is located in the middle between "사" and "자". (See line 19 and I check this character with green border in the Attached File 2)
2. When Korean is present in the line, the length of the selection area represents shorter than the input width of the input characters when selected. (See line 3, 19, 20, 21, 27, 28 in the Attached File 3)
I found that the same defect occurred in Windows11 and Windows10.
I hope it will be resolved as soon as possible.
The position of the popup representing the IntelliPrompt is wrong when shown on the monitor with the higher DPI scale, in a setup with two monitors with different DPI settings. For example, if one monitor has 100% DPI scale and the other 125%, the position of the popup will be wrong when the app is on the 125% monitor.
To work this around, use the Caret visual as the PlacementTarget for the popup and set its offsets to 0 after it is shown.
private void RadSyntaxEditor_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
if (KeyboardModifiers.IsControlDown && e.Key == Key.Space)
{
e.Handled = true;
var editor = (RadSyntaxEditor)sender;
CaretPosition startPosition = new CaretPosition(editor.CaretPosition);
CaretPosition endPosition = new CaretPosition(editor.CaretPosition);
editor.IntelliPrompts.CompletionListWindow.Show(startPosition, endPosition);
editor.IntelliPrompts.CompletionListWindow.HorizontalOffset = 0;
editor.IntelliPrompts.CompletionListWindow.VerticalOffset = 0;
}
}
private void RadSyntaxEditor_Loaded(object sender, System.Windows.RoutedEventArgs e)
{
var editor = (RadSyntaxEditor)sender;
var caret = editor.FindChildByType<Telerik.Windows.Controls.SyntaxEditor.UI.Caret>();
editor.IntelliPrompts.CompletionListWindow.PlacementTarget = caret;
editor.IntelliPrompts.CompletionListWindow.Placement = System.Windows.Controls.Primitives.PlacementMode.Bottom;
}
SyntaxEditor showing XML/Html/XAML File and XMlFoldingTagger is registered.
Deleting the last bracket symbol ">" results in exception in XMLFoldingTagger.cs
SyntaxEditor is in RadListBoxItem.
Entering space key does not produce text change and gets the focus lost our of the editor.
Workaround:
private void RadSyntaxEditor_PreviewKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Space)
{
(sender as RadSyntaxEditor).Insert(" ");
e.Handled = true;
}
}
For example:
some text // some comment
some text 2 // some comment 2
Specified argument was out of the range of valid values.
Parameter name: span
StackTrace:
at Telerik.Windows.SyntaxEditor.Core.Text.DataStructures.ConcatenationRopeNode.GetText(Span span) in C:\WPF_Scrum\Current\Controls\SyntaxEditor\SyntaxEditor.Core\Text\DataStructures\ConcatenationRopeNode.cs:line 140When the variation is changed in the VisualStudio2013 theme, the Foreground is not updated.
As a workaround, you can reset the Template of the control:
var template = this.syntaxEditor.Template;
this.syntaxEditor.Template = null;
this.syntaxEditor.Template = template;
Character data sections are not recognized and colored by the XmlTagger in SyntaxEditor.
Visual Studio:
SyntaxEditor:
Also parsing such elements is wrong:
Expanded OK:
Collapsed BUG (Node is closed but it shouldnt):
issue 2 - single line CDATA does not need folding button
//using System;
//usign System.Windows.Controls;
Two consecutive lines with commented using sections result in ArgumentOutOfRangeException in SyntaxEditor with CSharpFoldingTagger.
Shift + Alt + Down Selection then typing multiple characters results in all of them being typed in all selected lines.
Shift + Alt _ Down Selection then typing multiple characters results in only the first one being typed in all lines, then selection is lost and next chars are inserted in the last selected line only.
Default keystroke in other editors to activate text replacement is: ctrl+H
Would be nive to enable this in the syntax editor.
When using LineHighlightTagger a NullReferenceException is thrown. To workaround this exception, you can add a custom TextFormatDefinition object to the TextFormatDefinitions collection of the RadSyntaxEditor.
this.syntaxEditor.TextFormatDefinitions.AddLast(LineHighlightTagger.LineHighlightFormatDefinition, new TextFormatDefinition(new Telerik.Windows.Controls.SyntaxEditor.UI.Pen(new SolidColorBrush(Colors.Gray), new Thickness(1))));
Single line folding regions is falsely recognized (by default it should be avoided) and messes up with outer regions.
For example
1 [
2 [ inner region]
3]
There should be no folding button on the inner line. Collapsing line 1 does not collapse 3 but only 1 and 2 which is wrong.