akvelon / flutter-code-editor

Flutter Code Editor is a multi-platform code editor supporting syntax highlighting, code blocks folding, autocompletion, read-only code blocks, hiding specific code blocks, themes, and more.
https://akvelon.com
Apache License 2.0
197 stars 47 forks source link

set value moves selection improperly when foldable block is unfolded #182

Closed yescorp closed 1 year ago

yescorp commented 1 year ago

There are cases, when the user is editing the code, we need to unfold the foldable block.

E.g. User edits the next line after folded indent block. It is better to unfold the block to avoid mistakes because the user might not notice that the block is folded.

In this case when we unfold the block, cursor moves to the end of the first line of the block.

https://user-images.githubusercontent.com/79095619/217215499-ae933e1c-c3a9-4bdf-8fdd-7566fe4ff029.mov

This also happens when user adds new comment after folded comment block, and the same with imports.