mirror of
https://github.com/neovim/neovim.git
synced 2026-02-22 10:22:17 +10:00
When a list item contains a mapping key (e.g., '- element1:'), the
content under that key was incorrectly indented. The indent function
was not accounting for the '- ' prefix when calculating indentation
for nested content.
Example that now works correctly:
list:
- element1:
foo: bar # Now correctly at indent 6, not 4
The fix adds special handling in two places:
1. When previous line ends with ':' and starts with '- '
2. When looking up previous mapping key that is a list item
Fixes indentation to account for the 2-character '- ' prefix.
fixes: vim/vim#18943
closes: vim/vim#19133
9179ddc060
Co-authored-by: Cezar Dimoiu <cezar.dimoiu@keysight.com>