emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/subed 166988c 041/389: Special subtitle separator when mov


From: ELPA Syncer
Subject: [nongnu] elpa/subed 166988c 041/389: Special subtitle separator when moving to end of subtitle
Date: Fri, 3 Dec 2021 10:59:53 -0500 (EST)

branch: elpa/subed
commit 166988c3f4739b621b8484d81ef12613bc26ae84
Author: Random User <rndusr@posteo.de>
Commit: Random User <rndusr@posteo.de>

    Special subtitle separator when moving to end of subtitle
---
 subed/subed-srt.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/subed/subed-srt.el b/subed/subed-srt.el
index b5a812c..01adbcf 100644
--- a/subed/subed-srt.el
+++ b/subed/subed-srt.el
@@ -209,8 +209,11 @@ Return point or nil if point unless point did not change."
   (save-match-data
     (let ((orig-point (point)))
       (subed-srt-move-to-subtitle-text sub-id)
-      ;; Look for next separator or end of buffer
-      (let ((regex (concat "\\(" subed-srt--regexp-separator 
"[0-9]+\n\\|\\([[:blank:]]*\n*\\)\\'\\)")))
+      ;; Look for next separator or end of buffer.  We can't use
+      ;; `subed-srt--regexp-separator' here because if subtitle text is empty,
+      ;; it may be the only empty line in the separator, i.e. there's only one
+      ;; "\n".
+      (let ((regex (concat 
"\\([[:blank:]]*\n+[0-9]+\n\\|\\([[:blank:]]*\n*\\)\\'\\)")))
         (when (re-search-forward regex nil t)
           (goto-char (match-beginning 0))))
       (unless (= (point) orig-point)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]