[fix] Get right Column when use custom element replace text content. #417

Open
SuperSuperPepper wants to merge 1 commit from SuperSuperPepper/master into master
SuperSuperPepper commented 2023-11-15 03:04:27 -06:00 (Migrated from github.com)

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

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 commented 2025-04-12 14:15:58 -05:00 (Migrated from github.com)

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!

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!
This pull request is broken due to missing fork information.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'SuperSuperPepper/master:SuperSuperPepper/master'
git switch 'SuperSuperPepper/master'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'master'
git merge --no-ff 'SuperSuperPepper/master'
git switch 'SuperSuperPepper/master'
git rebase 'master'
git switch 'master'
git merge --ff-only 'SuperSuperPepper/master'
git switch 'SuperSuperPepper/master'
git rebase 'master'
git switch 'master'
git merge --no-ff 'SuperSuperPepper/master'
git switch 'master'
git merge --squash 'SuperSuperPepper/master'
git switch 'master'
git merge --ff-only 'SuperSuperPepper/master'
git switch 'master'
git merge 'SuperSuperPepper/master'
git push origin 'master'
Sign in to join this conversation.
No description provided.