mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-10-31 13:03:20 -07:00
enhance: update selected chunk after stage/discard/unstage previous chunk (#361)
This commit is contained in:
parent
6ac7ff2882
commit
6d11296eae
1 changed files with 8 additions and 0 deletions
|
@ -409,6 +409,7 @@ namespace SourceGit.Views
|
||||||
base.OnLoaded(e);
|
base.OnLoaded(e);
|
||||||
|
|
||||||
TextArea.TextView.ContextRequested += OnTextViewContextRequested;
|
TextArea.TextView.ContextRequested += OnTextViewContextRequested;
|
||||||
|
TextArea.TextView.PointerEntered += OnTextViewPointerEntered;
|
||||||
TextArea.TextView.PointerMoved += OnTextViewPointerMoved;
|
TextArea.TextView.PointerMoved += OnTextViewPointerMoved;
|
||||||
TextArea.TextView.PointerWheelChanged += OnTextViewPointerWheelChanged;
|
TextArea.TextView.PointerWheelChanged += OnTextViewPointerWheelChanged;
|
||||||
|
|
||||||
|
@ -420,6 +421,7 @@ namespace SourceGit.Views
|
||||||
base.OnUnloaded(e);
|
base.OnUnloaded(e);
|
||||||
|
|
||||||
TextArea.TextView.ContextRequested -= OnTextViewContextRequested;
|
TextArea.TextView.ContextRequested -= OnTextViewContextRequested;
|
||||||
|
TextArea.TextView.PointerEntered -= OnTextViewPointerEntered;
|
||||||
TextArea.TextView.PointerMoved -= OnTextViewPointerMoved;
|
TextArea.TextView.PointerMoved -= OnTextViewPointerMoved;
|
||||||
TextArea.TextView.PointerWheelChanged -= OnTextViewPointerWheelChanged;
|
TextArea.TextView.PointerWheelChanged -= OnTextViewPointerWheelChanged;
|
||||||
|
|
||||||
|
@ -480,6 +482,12 @@ namespace SourceGit.Views
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnTextViewPointerEntered(object sender, PointerEventArgs e)
|
||||||
|
{
|
||||||
|
if (EnableChunkSelection && sender is TextView view)
|
||||||
|
UpdateSelectedChunk(e.GetPosition(view).Y + view.VerticalOffset);
|
||||||
|
}
|
||||||
|
|
||||||
private void OnTextViewPointerMoved(object sender, PointerEventArgs e)
|
private void OnTextViewPointerMoved(object sender, PointerEventArgs e)
|
||||||
{
|
{
|
||||||
if (EnableChunkSelection && sender is TextView view)
|
if (EnableChunkSelection && sender is TextView view)
|
||||||
|
|
Loading…
Reference in a new issue