mirror of
https://github.com/neovim/neovim.git
synced 2025-09-05 19:08:15 +00:00
vim-patch:8.2.4675: no error for missing expression after :elseif
Problem: No error for missing expression after :elseif. (Ernie Rael)
Solution: Check for missing expression. (closes vim/vim#10068)
fa010cdfb1
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -899,7 +899,13 @@ void ex_else(exarg_T *eap)
|
||||
|
||||
if (eap->cmdidx == CMD_elseif) {
|
||||
bool error;
|
||||
result = eval_to_bool(eap->arg, &error, &eap->nextcmd, skip);
|
||||
// When skipping we ignore most errors, but a missing expression is
|
||||
// wrong, perhaps it should have been "else".
|
||||
if (skip && ends_excmd(*eap->arg)) {
|
||||
semsg(_(e_invexpr2), eap->arg);
|
||||
} else {
|
||||
result = eval_to_bool(eap->arg, &error, &eap->nextcmd, skip);
|
||||
}
|
||||
|
||||
// When throwing error exceptions, we want to throw always the first
|
||||
// of several errors in a row. This is what actually happens when
|
||||
|
Reference in New Issue
Block a user