Fix basevalue access before empty string check in parseIntoTree

l:basevalue[1] was accessed before checking if l:basevalue is empty.
Moved the empty check first so l:basedirect is only computed when
l:basevalue is non-empty.
This commit is contained in:
Yasuhiro Matsumoto
2026-03-07 16:46:10 +09:00
parent fbb61e7ef2
commit cc8b1a9f22

View File

@@ -156,10 +156,11 @@ function! emmet#lang#html#parseIntoTree(abbr, type) abort
endif
endif
let l:basedirect = l:basevalue[1] ==# '-' ? -1 : 1
if l:basevalue != ''
let l:basedirect = l:basevalue[1] ==# '-' ? -1 : 1
let l:basevalue = 0 + abs(l:basevalue[1:])
else
let l:basedirect = 1
let l:basevalue = 1
endif
if l:multiplier <= 0 | let l:multiplier = 1 | endif