fix delete behaviour
This commit is contained in:
parent
30157f1f5d
commit
e2022ef80e
|
|
@ -213,7 +213,7 @@ public static class KeyHelper
|
||||||
Add(Key.OemPipe);
|
Add(Key.OemPipe);
|
||||||
Add(Key.Oem6, '´', '`');
|
Add(Key.Oem6, '´', '`');
|
||||||
Add(Key.OemCloseBrackets);
|
Add(Key.OemCloseBrackets);
|
||||||
Add(Key.Oem7, 'ß', '?');
|
Add(Key.Oem7);
|
||||||
Add(Key.OemQuotes, 'ä', 'Ä');
|
Add(Key.OemQuotes, 'ä', 'Ä');
|
||||||
Add(Key.Oem8);
|
Add(Key.Oem8);
|
||||||
Add(Key.Oem102);
|
Add(Key.Oem102);
|
||||||
|
|
@ -250,7 +250,6 @@ public static class KeyHelper
|
||||||
Add(Key.Pa1);
|
Add(Key.Pa1);
|
||||||
Add(Key.OemClear);
|
Add(Key.OemClear);
|
||||||
Add(Key.DeadCharProcessed);
|
Add(Key.DeadCharProcessed);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void Add(Key key, params char[] chars)
|
private static void Add(Key key, params char[] chars)
|
||||||
|
|
|
||||||
|
|
@ -11,20 +11,35 @@
|
||||||
Title="MainWindow" Height="450" Width="800">
|
Title="MainWindow" Height="450" Width="800">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="50" />
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="5*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid Grid.Column="1">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="5*" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid Grid.Row="0">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="32" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<ListBox Grid.Column="0"
|
<ListBox Grid.Column="0"
|
||||||
ItemsSource="{Binding Lines.Count}"
|
ItemsSource="{Binding Lines.Count}"
|
||||||
IsHitTestVisible="False"
|
IsHitTestVisible="False"
|
||||||
Background="#252525" Foreground="#707070"
|
Background="#242628"
|
||||||
|
Foreground="#969696"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
Padding="0,0,5,0"
|
Padding="0,0,5,0"
|
||||||
VerticalContentAlignment="Top"
|
VerticalContentAlignment="Top"
|
||||||
HorizontalContentAlignment="Right"/>
|
HorizontalContentAlignment="Right"/>
|
||||||
|
|
||||||
<controls:EditorFrame Grid.Column="1" />
|
<controls:EditorFrame Grid.Column="1" />
|
||||||
|
</Grid>
|
||||||
|
<Grid Grid.Row="1" Background="#161718">
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|
|
||||||
|
|
@ -89,22 +89,21 @@ public class EditorFrameViewModel : ObservableObject
|
||||||
CurrentLineBuffer.Slice(0));
|
CurrentLineBuffer.Slice(0));
|
||||||
Lines.RemoveAt(CursorLine);
|
Lines.RemoveAt(CursorLine);
|
||||||
SetCursor(CursorLine - 1, position);
|
SetCursor(CursorLine - 1, position);
|
||||||
return;
|
|
||||||
} else
|
|
||||||
MoveCursor(0, -count);
|
|
||||||
} else {
|
} else {
|
||||||
if (CursorColumn + count >= CurrentLineBuffer.Tail &&
|
MoveCursor(0, -count);
|
||||||
|
CurrentLineBuffer.Delete(CursorColumn, count);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (CursorColumn + count > CurrentLineBuffer.Tail &&
|
||||||
CursorLine < Lines.Count - 1) {
|
CursorLine < Lines.Count - 1) {
|
||||||
CurrentLineBuffer.Insert(
|
CurrentLineBuffer.Insert(
|
||||||
CurrentLineBuffer.Tail,
|
CurrentLineBuffer.Tail,
|
||||||
Lines[CursorLine + 1].Slice(0));
|
Lines[CursorLine + 1].Slice(0));
|
||||||
Lines.RemoveAt(CursorLine + 1);
|
Lines.RemoveAt(CursorLine + 1);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
CurrentLineBuffer.Delete(CursorColumn, count);
|
CurrentLineBuffer.Delete(CursorColumn, count);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,11 +82,7 @@ public abstract class TailBuffer<T> : ICloneable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
protected virtual void SetTail(int tail)
|
||||||
/// Sets the tail, or, if omitted, seeks the tail by finding the first null terminator.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="tail"></param>
|
|
||||||
protected virtual void SetTail(int tail = -1)
|
|
||||||
{
|
{
|
||||||
Tail = tail;
|
Tail = tail;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue