Unable to put caret to the end of the line with cursor if it's not over text #145

Open
opened 2018-05-30 04:13:54 -05:00 by nicky1038 · 0 comments
nicky1038 commented 2018-05-30 04:13:54 -05:00 (Migrated from github.com)

Cursor changes its appearance from arrow to beam and allows putting caret by clicking left button not on entering the whole TextEditor control but only an area with written text. This area is nested TextViewer that is left- and top- aligned but not stretched.

Expected behavior: like in any other text editor control, if cursor is inside TextEditor but is not over any text, it should also change its appearance to Beam. If user attempts to left-click then caret should be put to the closest position in text.

I've found the problem, and if it was not made purposely, just a little change should be done.

The simpliest solution is to change ControlTemplate of TextEditor. ScrollViewer's HorizontalContentAlignment and VerticalContentAlignment should be Stretch but are Left and Top now.

Maybe users should have a choice by editing Options (but definitely not copying TextViewer's ControlTemplate from sources!), but the expected behavior should be by default.

Cursor changes its appearance from arrow to beam and allows putting caret by clicking left button not on entering the whole `TextEditor` control but only an area with written text. This area is nested `TextViewer` that is left- and top- aligned but not stretched. Expected behavior: like in any other text editor control, if cursor is inside `TextEditor` but is not over any text, it should also change its appearance to Beam. If user attempts to left-click then caret should be put to the closest position in text. I've found the problem, and if it was not made purposely, just a little change should be done. The simpliest solution is to change `ControlTemplate` of `TextEditor`. `ScrollViewer`'s `HorizontalContentAlignment` and `VerticalContentAlignment` should be `Stretch` but are `Left` and `Top` now. Maybe users should have a choice by editing `Options` (but definitely not copying `TextViewer`'s `ControlTemplate` from sources!), but the expected behavior should be by default.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-icsharpcode/AvalonEdit#145
No description provided.