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

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

[elpa] externals/coterm f48ef18 26/80: Fix \e[M and \e[L outside scrolli


From: ELPA Syncer
Subject: [elpa] externals/coterm f48ef18 26/80: Fix \e[M and \e[L outside scrolling region
Date: Wed, 13 Oct 2021 18:57:29 -0400 (EDT)

branch: externals/coterm
commit f48ef18d1c26558e185d33984004a29767953639
Author: m <>
Commit: m <>

    Fix \e[M and \e[L outside scrolling region
---
 coterm.el | 44 ++++++++++++++++++++++++--------------------
 1 file changed, 24 insertions(+), 20 deletions(-)

diff --git a/coterm.el b/coterm.el
index 75b343e..2e0029e 100644
--- a/coterm.el
+++ b/coterm.el
@@ -426,27 +426,31 @@ initialize it sensibly."
                               coterm--t-row coterm--t-col
                               coterm--t-row coterm--t-width))
                          (?L ;; \E[L - insert lines (terminfo: il, il1)
-                          (let*
-                              ((where (max coterm--t-row coterm--t-scroll-beg))
-                               (lines (+ (- coterm--t-row where) (car-or-1))))
-                            ;; Remove from bottom
-                            (coterm--t-delete-region
-                             (- coterm--t-scroll-end lines) 0
-                             coterm--t-scroll-end 0)
-                            ;; Insert at position
-                            (coterm--t-goto where 0)
-                            (coterm--t-open-space proc-filt process lines 0)))
+                          (when (<= coterm--t-scroll-beg coterm--t-row
+                                    (1- coterm--t-scroll-end))
+                            (let ((lines
+                                   (min (- coterm--t-scroll-end coterm--t-row)
+                                        (car-or-1))))
+                              ;; Remove from bottom
+                              (coterm--t-delete-region
+                               (- coterm--t-scroll-end lines) 0
+                               coterm--t-scroll-end 0)
+                              ;; Insert at position
+                              (coterm--t-goto coterm--t-row 0)
+                              (coterm--t-open-space proc-filt process lines 
0))))
                          (?M ;; \E[M - delete lines (terminfo: dl, dl1)
-                          (let ((lines
-                                 (min (car-or-1)
-                                      (max 0 (- coterm--t-scroll-end 
coterm--t-row)))))
-                            ;; Insert at bottom
-                            (coterm--t-goto coterm--t-scroll-end 0)
-                            (coterm--t-open-space proc-filt process lines 0)
-                            ;; Remove at position
-                            (coterm--t-delete-region
-                             coterm--t-row 0
-                             (+ coterm--t-row lines) 0)))
+                          (when (<= coterm--t-scroll-beg coterm--t-row
+                                    (1- coterm--t-scroll-end))
+                            (let ((lines
+                                   (min (- coterm--t-scroll-end coterm--t-row)
+                                        (car-or-1))))
+                              ;; Insert at bottom
+                              (coterm--t-goto coterm--t-scroll-end 0)
+                              (coterm--t-open-space proc-filt process lines 0)
+                              ;; Remove at position
+                              (coterm--t-delete-region
+                               coterm--t-row 0
+                               (+ coterm--t-row lines) 0))))
                          (?P ;; \E[P - delete chars (terminfo: dch, dch1)
                           (coterm--t-delete-region
                            coterm--t-row coterm--t-col



reply via email to

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