Avoid appending sentence_field on note updates#165
Merged
tatsumoto-ren merged 3 commits intoMar 25, 2026
Conversation
Member
|
Hey 👋 |
Member
Member
|
I've pushed an alternative fix. Tell me if it fixes your issue. |
Contributor
Author
|
@tatsumoto-ren Hi! I was new to this plugin and didn't see the whoe use case here. Your fixes works great for me. Thank you for helping out with this and also for making mpvacious. |
Member
|
Awesome! Thank you for contributing! |
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.


Summary
This changes append-mode note updates so they stop appending
sentence_field.Problem
The README says append mode should append to media fields:
Ctrl+m- append to the media fields of the newly added noteCtrl+b- append to the media fields of selected notesHowever, the current implementation also appends
sentence_field.This causes duplicated sentence content when updating notes created externally, for example by Rikaitan with the new note timer enabled.
Example:
The existing
update_sentence()logic already preserves target-word markup from the stored sentence field. Appending the full sentence field afterward defeats that behavior by concatenating the old and new sentences together.This also aligns with the existing comment in
update_sentence():That comment implies sentence updates should preserve the marked target in the updated sentence, not concatenate both the old and new sentence text.
Fix
Restrict append-mode field joining to:
audio_fieldimage_fieldmiscinfo_fieldsecondary_fieldLeave sentence text handling to
update_sentence(), which preserves existing target-word markup without duplicating the sentence contents.Result
Append mode still appends media, but sentence updates now produce the expected single sentence with preserved highlighting, e.g.: