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

Add Document get_index_from_location / get_location_from_index #3410

Merged
merged 4 commits into from
Oct 24, 2023

Conversation

davidbrochart
Copy link
Contributor

@davidbrochart davidbrochart commented Sep 27, 2023

Please review the following checklist.

  • Docstrings on all new or modified functions / classes
  • Updated documentation
  • Updated CHANGELOG.md (where appropriate)

@davidbrochart davidbrochart marked this pull request as draft September 27, 2023 08:55
@davidbrochart davidbrochart changed the title Add Document.get_index(location) Add Document get_index_from_location / get_location_from_index Sep 27, 2023
@davidbrochart davidbrochart force-pushed the document-index branch 3 times, most recently from 99c0288 to cbd1187 Compare September 30, 2023 16:07
@davidbrochart davidbrochart marked this pull request as ready for review September 30, 2023 16:07
@davidbrochart
Copy link
Contributor Author

I think these methods could be useful when some document changes come from a system which is not Location-aware, but only reports changes pointing to raw indexes in the document content, like in collaborative editing.

@willmcgugan
Copy link
Collaborator

@darrenburns Could you have a look at this one pls.

src/textual/document/_document.py Outdated Show resolved Hide resolved
src/textual/document/_document.py Show resolved Hide resolved
@davidbrochart
Copy link
Contributor Author

Thanks for the review @darrenburns, I made the changes, rebased and added some tests.

@darrenburns
Copy link
Member

Thanks @davidbrochart, could you also update the changelog?

@davidbrochart
Copy link
Contributor Author

Done.

@darrenburns darrenburns merged commit bc90a6a into Textualize:main Oct 24, 2023
22 checks passed
@darrenburns
Copy link
Member

Thanks!

@davidbrochart davidbrochart deleted the document-index branch October 24, 2023 17:28
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.

3 participants