vim-yaml
vim-yaml copied to clipboard
Don't re-indent when inside a string
When on the 2nd line of the following example, hitting return to add a new line causes the line to get re-indented to the same indentation level as the first line.
quotation: "this is a multi-line string that can span many lines and
shouldn't be re-indented when a new line is created"
The python indent file has logic which would guard against this:
" If the start of the line is in a string don't change the indent.
if has('syntax_items')
\ && synIDattr(synID(a:lnum, 1, 1), "name") =~ "String$"
return -1
endif