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

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

[nongnu] elpa/yaml-mode b153150e0e 2/2: Merge pull request #105 from Hi-


From: ELPA Syncer
Subject: [nongnu] elpa/yaml-mode b153150e0e 2/2: Merge pull request #105 from Hi-Angel/fix-indentation-mutability
Date: Wed, 29 Mar 2023 04:02:00 -0400 (EDT)

branch: elpa/yaml-mode
commit b153150e0e77b4ec462d741cdb16956c6ae270d6
Merge: 3fcb36d603 37da7fb9be
Author: Vasilij Schneidermann <mail@vasilij.de>
Commit: GitHub <noreply@github.com>

    Merge pull request #105 from Hi-Angel/fix-indentation-mutability
    
    Do not modify the buffer in `yaml-indent-line` unless necessary
---
 yaml-mode.el | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/yaml-mode.el b/yaml-mode.el
index fc46e0582a..1cfef236dd 100644
--- a/yaml-mode.el
+++ b/yaml-mode.el
@@ -368,11 +368,9 @@ back-dent the line by `yaml-indent-offset' spaces.  On 
reaching column
   (let ((ci (current-indentation))
         (need (yaml-compute-indentation)))
     (save-excursion
-      (beginning-of-line)
-      (delete-horizontal-space)
       (if (and (equal last-command this-command) (/= ci 0))
-          (indent-to (* (/ (- ci 1) yaml-indent-offset) yaml-indent-offset))
-        (indent-to need)))
+          (indent-line-to (* (/ (- ci 1) yaml-indent-offset) 
yaml-indent-offset))
+        (indent-line-to need)))
     (if (< (current-column) (current-indentation))
         (forward-to-indentation 0))))
 



reply via email to

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