Repository navigation
Zotero: text typed just after a citation goes outside its field - #1162
Merged
Merged
Conversation
# Conflicts: # docs/typing-parity.md
Member
|
Thanks for the contribution, @marcoarnulfo! This has landed in main. If you haven't already, come join us on Discord: https://discord.gg/artcraft |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #898.
A range field's end marker takes no room, so a click just after a citation puts the caret before it: whatever you typed there went into the citation's result, Zotero then saw the citation as edited by hand, and asked to replace it when you added another citation or the bibliography (it reported the caret as inside the field). Right after inserting a citation it worked only because the bridge leaves the caret after the marker. Now a collapsed caret sitting on one or more field ends is moved past them (
Document::past_field_ends) before typing/pasting, before Zotero inserts a field, and when Zotero asks whether the cursor is in a field, which matches Word, where text typed right after a field lands outside it. The arrow-key step over the invisible marker the reporter noticed is unchanged; happy to look at that separately if you'd like.Validation:
tests_typing::typing_after_a_citation_goes_outside_its_field(clicks just after the citation through the layout, then types): fails on main (field result becomes(Smith 2020). Dogs bark.), passes herezotero tests::a_citation_added_just_after_another_is_not_nested_in_it: fails on main (Document_cursorInFieldreturns the first citation), passes herecargo test -p wordcraft-engine --lib tests_typing::,cmd::fields,cmd::citations,cmd::controls,cmd::speech;cargo test -p wordcraft-zotero --lib tests::cargo clippy -p wordcraft-doc -p wordcraft-engine -p wordcraft-zotero --all-targets -- -D warnings,cargo fmt --all -- --check