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

Fix missing cross references on newly saved file #13066

Merged
merged 1 commit into from
Apr 29, 2023

Conversation

timtmok
Copy link
Contributor

@timtmok timtmok commented Apr 28, 2023

Intent

Address #12882 for newly saved files

Approach

Fixing another issue from a newly saved file. The cross reference index is generated for a rendered file after the file is saved without performing the indexing. The newer rendered index is preferred over performing the index on the saved file causing no cross references.

Since the rendered cross reference index is not populated with data, it can be size checked to determine if the saved file needs the cross references indexed. For a file that actually has no cross references, this rendered index would have a non-zero file size.

Reordered the index check to short circuit the expression check in this order: rendered index does not exist, rendered index has no content, file index is newer than rendered index

Automated Tests

None

QA Notes

Steps to reproduce:

  1. Create a Quarto document using File -> New File -> Quarto Document
  2. Add in content that would allow cross references to show (see issue)
  3. Save the file
  4. Invoke Insert -> Cross References

Documentation

None

Checklist

  • If this PR adds a new feature, or fixes a bug in a previously released version, it includes an entry in NEWS.md
  • If this PR adds or changes UI, the updated UI meets accessibility standards
  • A reviewer is assigned to this PR (if unsure who to assign, check Area Owners list)
  • This PR passes all local unit tests

@timtmok timtmok requested a review from jjallaire April 28, 2023 19:36
@timtmok timtmok merged commit 33b76b1 into main Apr 29, 2023
@timtmok timtmok deleted the bugfix/cross-reference-newfile branch April 29, 2023 01:01
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.

None yet

2 participants