-
Notifications
You must be signed in to change notification settings - Fork 16
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
subed recenters on save, breaking scroll-all-mode #35
Comments
I just spent 20 minutes trying to disable this feature and I couldn't figure out
how. Either my Emacs-fu is too rusty or the recentering is implemented somewhere
else.
If you can find out how to disable it, feel free to make a PR.
|
thanks for taking a look. unfortunately i'm more subtitler than programmer. my emacs debugging mostly amounts to enabling edebug-defun and hitting space bar and looking on. seems like its in subed-srt--sort, but not the santitize or validate functions it runs, or in subed-save-excursion. the latter i struggled to take a look at w my beginner's skills. if i swapped it out for a vanilla save-excursion, point would be at beginning of buffer after save. thanks anyway, and again for the package. |
a workaround to run recenter-top-bottom after saving, only when in subed mode:
|
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.
first, thx for your great package, it's nifty as.
so subed recenters, or rather scrolls so that point is 4/5 down the frame, on save. i guess in its sanitizing of things.
i didn't mind it all that much until i started using scroll-all-mode, which allows you to synchronize the scrolling of two windows. using it with subed, you can align the scrolling of two subtitles files, for translating. but when i save my srt file, only one of the windows gets recentered, putting the synchronized scroll out of sync.
it's not a killer issue, but perhaps it's also simple to avoid?
update: hm maybe scroll-all-mode is just too bare bones, as it really ought to work with recenter, which emacs calls the "basic scrolling command"(!). perhaps some subed users have an alternative approach for synchronized scrolling?
i guess scroll-syncing the subtitles by their numbers would be a colossal effort? that would be killer, but i'm not sure how it could be done.
The text was updated successfully, but these errors were encountered: