Skip to content

Conversation

SuperSuperPepper
Copy link

If you want to use custom elements replace text content.
example: I want to use custom elements to change some keywords by using the menu, button or other elements for my special feature.
you will get the wrong caret position when you click textview .
because GetVisualColumn doesn't calculate generator elements. so need to recalculate the column.
this PR can fix #416

@siegfriedpammer
Copy link
Member

I tested your fix using ICSharpCode.AvalonEdit.Sample which contains the ImageElementGenerator and without your fix clicking right of an inserted image puts the caret into the correct location. With your fix, however, the exact problem occurs that you described in your original issue.

Maybe there is something wrong with your custom element generator? Hard to say, without access to your code. Please take a look at our sample code. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using VisualLineElementGenerator will cause the caret position wrong

2 participants