Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintain selection on update in code and text mode #563

Open
josdejong opened this issue Aug 12, 2018 · 0 comments
Open

Maintain selection on update in code and text mode #563

josdejong opened this issue Aug 12, 2018 · 0 comments
Labels

Comments

@josdejong
Copy link
Owner

Since version v5.20.0, JSONEditor contains new methods update and updateText which keep the current state of the editor when in modes tree, form, and view. These methods work for text and code too, but there the caret position is lost when updating the contents of the editor.

It would be great if the caret position could be maintained too. Ace editor has support for updating with a text diff, that will be really useful. I think we'll need a text diff library to determine which parts are changed, so we can calculate how much the old selection needs to move up or down to match the same contents.

@josdejong josdejong changed the title Improve update in code and text mode Maintain selection on update in code and text mode Aug 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant