mirror of
https://github.com/haven1433/HexManiacAdvance.git
synced 2026-10-02 13:16:35 -05:00
rename paste to paste / replace, since it does an overwrite
fix a crash when using goto from the search results tab fix goto not working on a tab if you get to that tab by closing the selected tab
This commit is contained in:
@@ -164,9 +164,7 @@ namespace HavenSoft.HexManiac.Core.ViewModels {
|
||||
if (TryUpdate(ref selectedIndex, value)) {
|
||||
findPrevious.CanExecuteChanged.Invoke(findPrevious, EventArgs.Empty);
|
||||
findNext.CanExecuteChanged.Invoke(findNext, EventArgs.Empty);
|
||||
GotoViewModel.PropertyChanged -= GotoPropertyChanged;
|
||||
GotoViewModel = new GotoControlViewModel(SelectedTab);
|
||||
GotoViewModel.PropertyChanged += GotoPropertyChanged;
|
||||
UpdateGotoViewModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -407,6 +405,7 @@ namespace HavenSoft.HexManiac.Core.ViewModels {
|
||||
if (selectedIndex == tabs.Count) TryUpdate(ref selectedIndex, tabs.Count - 1, nameof(SelectedIndex));
|
||||
CollectionChanged?.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, tab, index));
|
||||
}
|
||||
UpdateGotoViewModel();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -448,6 +447,12 @@ namespace HavenSoft.HexManiac.Core.ViewModels {
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateGotoViewModel() {
|
||||
GotoViewModel.PropertyChanged -= GotoPropertyChanged;
|
||||
GotoViewModel = new GotoControlViewModel(SelectedTab);
|
||||
GotoViewModel.PropertyChanged += GotoPropertyChanged;
|
||||
}
|
||||
|
||||
private void ForwardDelayedWork(object sender, Action e) => RequestDelayedWork?.Invoke(this, e);
|
||||
|
||||
private void TabPropertyChanged(object sender, PropertyChangedEventArgs e) {
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace HavenSoft.HexManiac.Core.ViewModels {
|
||||
set {
|
||||
if (viewPort == null) return;
|
||||
if (TryUpdate(ref text, value)) {
|
||||
var options = viewPort.Model.GetAutoCompleteAnchorNameOptions(text);
|
||||
var options = viewPort.Model?.GetAutoCompleteAnchorNameOptions(text) ?? new string[0];
|
||||
AutoCompleteOptions = CreateAutoCompleteOptions(options, options.Count);
|
||||
ShowAutoCompleteOptions = AutoCompleteOptions.Count > 0;
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@
|
||||
<Separator />
|
||||
<MenuItem Header="Cu_t" Command="{Binding Cut}" InputGestureText="Ctrl+X"/>
|
||||
<MenuItem Header="_Copy" Command="{Binding Copy}" InputGestureText="Ctrl+C"/>
|
||||
<MenuItem Header="_Paste" Command="{Binding Paste}" InputGestureText="Ctrl+V"/>
|
||||
<MenuItem Header="_Paste / Replace" Command="{Binding Paste}" InputGestureText="Ctrl+V"/>
|
||||
<MenuItem Header="_Delete" Command="{Binding Delete}" InputGestureText="Del"/>
|
||||
<Separator />
|
||||
<MenuItem Header="_Find" Command="{Binding ShowFind}" InputGestureText="Ctrl+F">
|
||||
|
||||
Reference in New Issue
Block a user