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.Oem6, '´', '`');
|
||||
Add(Key.OemCloseBrackets);
|
||||
Add(Key.Oem7, 'ß', '?');
|
||||
Add(Key.Oem7);
|
||||
Add(Key.OemQuotes, 'ä', 'Ä');
|
||||
Add(Key.Oem8);
|
||||
Add(Key.Oem102);
|
||||
|
|
@ -250,7 +250,6 @@ public static class KeyHelper
|
|||
Add(Key.Pa1);
|
||||
Add(Key.OemClear);
|
||||
Add(Key.DeadCharProcessed);
|
||||
|
||||
}
|
||||
|
||||
private static void Add(Key key, params char[] chars)
|
||||
|
|
|
|||
|
|
@ -11,20 +11,35 @@
|
|||
Title="MainWindow" Height="450" Width="800">
|
||||
<Grid>
|
||||
<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="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<ListBox Grid.Column="0"
|
||||
ItemsSource="{Binding Lines.Count}"
|
||||
IsHitTestVisible="False"
|
||||
Background="#252525" Foreground="#707070"
|
||||
Background="#242628"
|
||||
Foreground="#969696"
|
||||
BorderThickness="0"
|
||||
Padding="0,0,5,0"
|
||||
VerticalContentAlignment="Top"
|
||||
HorizontalContentAlignment="Right"/>
|
||||
|
||||
<controls:EditorFrame Grid.Column="1" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="1" Background="#161718">
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
|
|
|||
|
|
@ -89,22 +89,21 @@ public class EditorFrameViewModel : ObservableObject
|
|||
CurrentLineBuffer.Slice(0));
|
||||
Lines.RemoveAt(CursorLine);
|
||||
SetCursor(CursorLine - 1, position);
|
||||
return;
|
||||
} else
|
||||
MoveCursor(0, -count);
|
||||
} else {
|
||||
if (CursorColumn + count >= CurrentLineBuffer.Tail &&
|
||||
MoveCursor(0, -count);
|
||||
CurrentLineBuffer.Delete(CursorColumn, count);
|
||||
}
|
||||
} else {
|
||||
if (CursorColumn + count > CurrentLineBuffer.Tail &&
|
||||
CursorLine < Lines.Count - 1) {
|
||||
CurrentLineBuffer.Insert(
|
||||
CurrentLineBuffer.Tail,
|
||||
Lines[CursorLine + 1].Slice(0));
|
||||
Lines.RemoveAt(CursorLine + 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
CurrentLineBuffer.Delete(CursorColumn, count);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
|
|
|
|||
|
|
@ -82,11 +82,7 @@ public abstract class TailBuffer<T> : ICloneable
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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)
|
||||
protected virtual void SetTail(int tail)
|
||||
{
|
||||
Tail = tail;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue