runtime(yaml): fix indentation script

Commit: 
https://github.com/vim/vim/commit/af973d401803fb1110f699ced6df45b74fcaed2b
Author: Bjoern Foersterling <[email protected]>
Date:   Thu Jan 15 20:05:58 2026 +0000

    runtime(yaml): fix indentation script
    
    Problem:  The indentation of Ansible Playbooks gets messed up after
              gg=G (after 9179ddc0608813e)
    Solution: Remove one shiftwidth() that seems to be misplaced.
    
    closes: #19180
    
    Signed-off-by: Bjoern Foersterling <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/runtime/indent/testdir/yaml.in b/runtime/indent/testdir/yaml.in
index 32b56a73f..8500b0d8c 100644
--- a/runtime/indent/testdir/yaml.in
+++ b/runtime/indent/testdir/yaml.in
@@ -26,3 +26,14 @@ list:
   - element2:
       foo: bar
 # END_INDENT
+
+# START_INDENT
+- name: test playbook
+  hosts: localhost
+  gather_facts: false
+
+  tasks:
+    - name: hello world
+      ansible.builtin.debug:
+        msg: "hello world"
+# END_INDENT
diff --git a/runtime/indent/testdir/yaml.ok b/runtime/indent/testdir/yaml.ok
index 0bfabfc16..86a3ce481 100644
--- a/runtime/indent/testdir/yaml.ok
+++ b/runtime/indent/testdir/yaml.ok
@@ -26,3 +26,14 @@ list:
   - element2:
       foo: bar
 # END_INDENT
+
+# START_INDENT
+- name: test playbook
+  hosts: localhost
+  gather_facts: false
+
+  tasks:
+    - name: hello world
+      ansible.builtin.debug:
+        msg: "hello world"
+# END_INDENT
diff --git a/runtime/indent/yaml.vim b/runtime/indent/yaml.vim
index fb0f055dc..1b0110e8f 100644
--- a/runtime/indent/yaml.vim
+++ b/runtime/indent/yaml.vim
@@ -6,6 +6,7 @@
 " 2024 Feb 29 by Vim project: disable mulitline indent by default
 " 2024 Aug 14 by Vim project: fix re-indenting when commenting out lines
 " 2026 Jan 08 by Vim project: fix object indentation in array
+" 2026 Jan 15 by Vim project: fix double shiftwidth from previous change
 
 " Only load this indent file when no other was loaded.
 if exists('b:did_indent')
@@ -146,7 +147,7 @@ function GetYAMLIndent(lnum)
             " Previous mapping key is in a list item (- key:)
             " The key effectively starts at indent + 2 (after "- ")
             " Content under it should be indented relative to the key position
-            return indent(prevmapline) + 2 + shiftwidth()
+            return indent(prevmapline) + 2
         else
             return indent(prevmapline)
         endif

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1vgTkJ-00Egy0-Il%40256bit.org.

Raspunde prin e-mail lui