From 74fa3107189c4a9f7529e8cace97fc3fb4e1f49b Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Sat, 11 Sep 2021 10:48:38 -0700 Subject: [PATCH] Fix multi-select with highlighted target If you select a line that refers to another line, the target line's address is highlighted. If you select multiple lines, the highlight is removed. The code that removes the highlight was inadvertently resetting the selection, making it impossible to shift-click a range that ended with a highlighted line. --- SourceGen/WpfGui/MainWindow.xaml.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/SourceGen/WpfGui/MainWindow.xaml.cs b/SourceGen/WpfGui/MainWindow.xaml.cs index 393a957..4f266d2 100644 --- a/SourceGen/WpfGui/MainWindow.xaml.cs +++ b/SourceGen/WpfGui/MainWindow.xaml.cs @@ -1004,12 +1004,8 @@ namespace SourceGen.WpfGui { private void CodeListView_ReplaceEntry(int index, DisplayList.FormattedParts newParts) { bool isSelected = CodeDisplayList.SelectedIndices[index]; if (isSelected && codeListView.SelectionMode != SelectionMode.Single) { - if (codeListView.SelectionMode != SelectionMode.Single) { - Debug.WriteLine("HEY: hit unhappy single-select case"); - codeListView.SelectedIndex = -1; - } else { - codeListView.SelectedItems.Remove(CodeDisplayList[index]); - } + // Remove entry from selected items list in ListView control. + codeListView.SelectedItems.Remove(CodeDisplayList[index]); } CodeDisplayList[index] = newParts; if (isSelected) {