emacs-diffs
[Top][All Lists]
Advanced

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

master 6abf1c038f6 1/2: Fix 'delete-rectangle' with multi-column charact


From: Eli Zaretskii
Subject: master 6abf1c038f6 1/2: Fix 'delete-rectangle' with multi-column characters
Date: Thu, 28 Dec 2023 04:00:36 -0500 (EST)

branch: master
commit 6abf1c038f6c74f2e56078228cdf8a0cda40c6b3
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Fix 'delete-rectangle' with multi-column characters
    
    * lisp/rect.el (delete-rectangle-line): Support multi-column
    characters, when STARTCOL is in the middle of such a character.
    (Bug#67925)
---
 lisp/rect.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/rect.el b/lisp/rect.el
index 8dc188b1de0..9049e322ca6 100644
--- a/lisp/rect.el
+++ b/lisp/rect.el
@@ -212,7 +212,10 @@ The returned value has the form of (WIDTH . HEIGHT)."
       (cons width height))))
 
 (defun delete-rectangle-line (startcol endcol fill)
-  (when (= (move-to-column startcol (if fill t 'coerce)) startcol)
+  ;; We use >= here, not =, for characters that use more than one
+  ;; column on display, when STARTCOL is in the middle of such a
+  ;; character.
+  (when (>= (move-to-column startcol (if fill t 'coerce)) startcol)
     (delete-region (point)
                   (progn (move-to-column endcol 'coerce)
                          (point)))))



reply via email to

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