diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditorView.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditorView.cs index 7d72090d01..6db6221e78 100755 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditorView.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditorView.cs @@ -436,6 +436,11 @@ namespace ICSharpCode.AvalonEdit.AddIn var parent = currentNode.Parent; + // it can happen that parent region exactly matches child region - in this case we need to advance even to the next parent + // bc otherwise the selection would never move + while (parent != null && parent.StartLocation == selectionStart && parent.EndLocation == selectionEnd) { + parent = parent.Parent; + } if (parent == null) return; selectionStart = parent.StartLocation;