-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try to avoid sorting already-sorted buffers
This should reduce the disruption to things like the mark ring. (Related to #57 and #55, and might address #35 as well?) * subed/subed-common.el (sanitize): Separate the sanitize and sanitize-format functions. (sanitize-format): New generic function. (validate): Separate the validate and validate-format functions. (validate-format): New generic function. (regenerate-ids): Have generic implementation. (subed-sanitize-functions): Move to subed-config.el. (subed-validate-functions): Move to subed-config.el. (subed-prepare-to-save): Call subed-sanitize and subed-validate. (subed--sorted-p): New function to test if the subtitles are sorted. (sort): Make interactive. Sort only if unsorted, which should minimize interference with flycheck and the mark ring. * subed/subed-config.el (subed-sanitize-functions): New customizable variable. (subed-validate-functions): New customizable variable. * subed/subed-srt.el (subed--sanitize-format): Define this instead of subed--sanitize. (subed--validate-format): Define this instead of subed--validate. * subed/subed-vtt.el (subed--sanitize-format): Define this instead of subed--sanitize. (subed--validate-format): Define this instead of subed--validate. (subed--sort): Remove format-specific implementation. * tests/test-subed-common.el ("Trimming subtitles when configured to check on save reports overlaps."): Specify options. ("Sorting"): Add test cases. * tests/test-subed-vtt.el ("Sorting preserves point in the current subtitle when subtitle text is empty."): Tweak position check.
- Loading branch information
Showing
7 changed files
with
142 additions
and
75 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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