Skip to content

Commit

Permalink
fix selection after shifting
Browse files Browse the repository at this point in the history
when the selection started at the beginning of a line
  • Loading branch information
scheffle committed Oct 31, 2024
1 parent ed1ba65 commit c551e95
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions vstgui/lib/ctexteditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2163,7 +2163,6 @@ bool TextEditorView::doShifting (bool right) const
}
md.editState.select_start = originSelectStart + 1;
md.editState.select_end = originSelectEnd + numChanges;
md.editState.cursor = md.editState.select_start;
}
else
{
Expand All @@ -2181,8 +2180,14 @@ bool TextEditorView::doShifting (bool right) const
}
md.editState.select_start = originSelectStart - (numChanges ? 1 : 0);
md.editState.select_end = originSelectEnd - numChanges;
md.editState.cursor = md.editState.select_start;
}
if (hasSelection)
{
if (originSelectStart == lineStart->range.start)
md.editState.select_start = originSelectStart;
}

md.editState.cursor = md.editState.select_start;
onCursorChanged (originCursor, md.editState.cursor);
onSelectionChanged (makeRange (md.editState));
return true;
Expand Down

0 comments on commit c551e95

Please sign in to comment.