[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/subed 57c902a 068/389: subed-srt-sanitize: Don't change bu
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/subed 57c902a 068/389: subed-srt-sanitize: Don't change buffer unless it's necessary |
Date: |
Fri, 3 Dec 2021 10:59:58 -0500 (EST) |
branch: elpa/subed
commit 57c902afd97aada37205f1b6d42e63548a4207e5
Author: Random User <rndusr@posteo.de>
Commit: Random User <rndusr@posteo.de>
subed-srt-sanitize: Don't change buffer unless it's necessary
---
subed/subed-srt.el | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/subed/subed-srt.el b/subed/subed-srt.el
index 0a80d4e..f876108 100644
--- a/subed/subed-srt.el
+++ b/subed/subed-srt.el
@@ -487,14 +487,15 @@ each subtitle."
(while (subed-srt-forward-subtitle-id)
(let ((prev-sub-end (save-excursion (when
(subed-srt-backward-subtitle-end)
(point)))))
- (when prev-sub-end
+ (when (and prev-sub-end
+ (not (string= (buffer-substring prev-sub-end (point))
"\n\n")))
(delete-region prev-sub-end (point))
(insert "\n\n"))))
;; Remove trailing newlines
(goto-char (point-max))
(subed-srt-move-to-subtitle-end)
- (when (looking-at "\n*")
+ (when (looking-at "\n\\{2,\\}")
(replace-match "\n"))
;; Ensure there is one space before and after " --> "
- [nongnu] elpa/subed 5c51000 101/389: Call time-adjusted-hook functions with start time, not stop time, (continued)
- [nongnu] elpa/subed 5c51000 101/389: Call time-adjusted-hook functions with start time, not stop time, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 53d1e33 102/389: Fix error when adjusting start/stop time in empty buffer, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed a0cb0f1 108/389: Keep region active during subtitle movement, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 2c7554a 109/389: Wrap subed--for-each-subtitle in atomic-change-group, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed e792e0f 122/389: Fix test description, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 489bbea 130/389: Remove subed-milliseconds-move, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed a7dda70 137/389: Add subtitle shifting to features, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed a819a93 139/389: Fix test description, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 06851d8 143/389: Prevent overlapping when adjusting subtitle start/stop time, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 651c6de 031/389: Wrap some function bodies in save-match-data, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 57c902a 068/389: subed-srt-sanitize: Don't change buffer unless it's necessary,
ELPA Syncer <=
- [nongnu] elpa/subed 1571de4 070/389: Use prefix arg to set start/stop time adjustment, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed f832a1d 075/389: Add more tests for subed-srt-move-to-subtitle-end, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 8374498 076/389: README: Split feature list and some rewording, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed d0708e5 080/389: Fix screenshot, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 03cd2bf 097/389: Wrap msecs-to-timestamp in save-match-data, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 4960c74 098/389: Make timestamp parsing more robust, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 9b95137 104/389: Test subed--for-each-subtitle more thoroughly, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed ec03689 105/389: Fix subed--for-each-subtitle, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed a7cbce6 107/389: Test subed-move-subtitle-forward/backward more thoroughly, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 5da6d79 112/389: Add "pause with key" to features, ELPA Syncer, 2021/12/03