runtime(vim): update indentation plugin for Vim script

Make the indent script aware of enums and ensure those will be correctly
indented.

fixes: #16289
closes: #16293

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Jim Zhou <csd_189@163.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Jim Zhou
2024-12-26 10:30:37 +01:00
committed by Christian Brabandt
parent b9ea0a89fa
commit 6d2efd4920
3 changed files with 52 additions and 5 deletions

View File

@ -947,6 +947,20 @@ Black
endenum
" END_INDENT
" START_INDENT
enum Digits
INVALID(v:numbermax), # The null value.
ZERO(0 * v:numbermin), ONE(2 - 1),
TWO(1 + 1), THREE(9 / 3), FOUR(1 * 4),
FIVE(1 + 2 + 2), SIX(36 / 3 / 2), SEVEN(7), EIGHT(2 * 2 * 2),
NINE(3 + 3 + 3)
const value: number
def new(value: number)
this.value = value
enddef
endenum
" END_INDENT
" START_INDENT
call prop_type_add('indent_after_literal_dict', #{ foo: 'bar' })
call prop_type_delete('indent_after_literal_dict')

View File

@ -940,10 +940,24 @@ endinterface
" START_INDENT
enum Color
White,
Red,
Green,
Blue,
Black
Red,
Green,
Blue,
Black
endenum
" END_INDENT
" START_INDENT
enum Digits
INVALID(v:numbermax), # The null value.
ZERO(0 * v:numbermin), ONE(2 - 1),
TWO(1 + 1), THREE(9 / 3), FOUR(1 * 4),
FIVE(1 + 2 + 2), SIX(36 / 3 / 2), SEVEN(7), EIGHT(2 * 2 * 2),
NINE(3 + 3 + 3)
const value: number
def new(value: number)
this.value = value
enddef
endenum
" END_INDENT