Mercurial > vim
diff src/vim9script.c @ 20351:680296770464 v8.2.0731
patch 8.2.0731: Vim9: parsing declarations continues after :finish
Commit: https://github.com/vim/vim/commit/7e5bd91dc99e1ecb38c4220eaab1a906a69815c2
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun May 10 21:20:29 2020 +0200
patch 8.2.0731: Vim9: parsing declarations continues after :finish
Problem: Vim9: parsing declarations continues after :finish.
Solution: Bail out when encountering :finish.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 10 May 2020 21:30:04 +0200 |
parents | 7587d892c00c |
children | 918b9a05cf35 |
line wrap: on
line diff
--- a/src/vim9script.c +++ b/src/vim9script.c @@ -130,6 +130,12 @@ ex_vim9script(exarg_T *eap) vim_free(((char_u **)(gap->ga_data))[--gap->ga_len]); ((char_u **)(gap->ga_data))[gap->ga_len++] = NULL; } + else if (checkforcmd(&p, "finish", 4)) + { + // TODO: this should not happen below "if false". + // Use "if cond | finish | endif as a workaround. + break; + } } // Compile the :def functions.