Set readonly false for selection and scroll to out of view code

Hi, i want to achieve these 2 features using @uiw/react-codemirror

  1. Scroll to searched position if out of viewport
  2. Set readonly false only for selection , i know it is achievable using markText but i cant seem to find that method on EditorView instance

Fixed 1 with viewState.lineBlockAt(startPos). Still looking for 2’s solution

markText is part of the 5.x API, EditorView suggests you’re using 6.x. I can’t quite figure out what you’re trying to do from the description, but controlling editability of specific parts of the text is now done with change filters.

Thanks for response @marijn , really appreciate. From what I know change filters are defined on initialization. I am using react as my framework and also I want to handle these on every update so the solution I am looking for should be able to work dynamically , given the document can change anytime during user interaction as user can add new lines / remove existing ones