-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[OO/CSL] Instantaneous citation insertion and refresh #12849
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
Conversation
Signed-off-by: subhramit <subhramit.bb@live.in>
Signed-off-by: subhramit <subhramit.bb@live.in>
@@ -598,6 +598,10 @@ public void guiActionInsertEntry(List<BibEntry> entries, | |||
if (style instanceof CitationStyle citationStyle) { | |||
// Handle insertion of CSL Style citations | |||
|
|||
// Lock document controllers - disable refresh during the process (avoids document flicker during writing) | |||
// MUST always be paired with an unlockControllers() call | |||
doc.lockControllers(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The lockControllers() and unlockControllers() calls should be wrapped in a try-finally block to ensure that unlockControllers() is always called, even if an exception occurs.
@@ -609,6 +613,9 @@ public void guiActionInsertEntry(List<BibEntry> entries, | |||
cslCitationOOAdapter.insertEmptyCitation(cursor.get(), citationStyle, entries); | |||
} | |||
|
|||
// Release controller lock | |||
doc.unlockControllers(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unlockControllers() call should be in a finally block to ensure it is executed even if an exception is thrown, maintaining the document's state integrity.
@trag-bot didn't find any issues in the code! ✅✨ |
The build for this PR is no longer available. Please visit https://builds.jabref.org/main/ for the latest build. |
Reverted and superseded by #12851
Mandatory checks
CHANGELOG.md
described in a way that is understandable for the average user (if change is visible to the user)