Fix virtual text for vim 8.2 (#4291)

Regression was introduced in d93bc2baf7

The problem was that we did not handle the edge case where there is no
last popup to close, which caused old vim versions to enter code by
accident that was only supposed to be run by vim 9.

We fix this by guarding the if condition for vim 9.

Fixes #4290
This commit is contained in:
Magnus Groß
2022-09-06 12:35:13 +02:00
committed by GitHub
parent 6996d1c14d
commit 4943b7d39f

View File

@@ -39,7 +39,7 @@ function! ale#virtualtext#Clear() abort
call prop_remove({'type': 'ale'})
call popup_close(s:last_virt)
let s:last_virt = -1
elseif s:last_virt != 1
elseif !s:emulate_virt && s:last_virt != 1
call prop_remove({'id': s:last_virt})
let s:last_virt = 1
endif