[vim/vim] Incorrect YAML object indentation in array (Issue #18943)

2 views
Skip to first unread message

Théo Brigitte

unread,
11:08 AM (10 hours ago) 11:08 AM
to vim/vim, Subscribed
TheoBrigitte created an issue (vim/vim#18943)

Steps to reproduce

Problem

YAML indentation is incorrect when trying to indent a list containing objects.

How to reproduce

  1. Create the following test.yaml file
list:
  - element1:
      foo: bar
  - element2:
      foo: bar
  1. Indent the file using =G

  2. Result

list:
  - element1:
    foo: bar
  - element2:
    foo: bar

Expected behaviour

The foo: bar lines are incorrectly indented, they miss one indentation level as they belong under the element 1 & 2 objects.

I expect the content to stay as is since the indentation is correct.

Version of Vim

9.1.1908

Environment

Operation system: Linux x1 6.6.107-1-MANJARO #1 SMP PREEMPT_DYNAMIC Fri Sep 19 17:32:57 UTC 2025 x86_64 GNU/Linux
Terminal: xfce4-terminal 1.1.5 (Xfce 4.20)
Value of $TERM: xterm-256color
Shell: GNU bash, version 5.3.3(1)-release (x86_64-pc-linux-gnu)

Logs and stack traces


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18943@github.com>

Reply all
Reply to author
Forward
0 new messages