Mercurial > vim
comparison src/ex_docmd.c @ 23974:d4f7e4138544 v8.2.2529
patch 8.2.2529: Vim9: Not possible to use legacy and Vim9 script in one file
Commit: https://github.com/vim/vim/commit/d3f8a9ee65b249d073343e43e423bc3348dd09d0
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Feb 17 21:57:03 2021 +0100
patch 8.2.2529: Vim9: Not possible to use legacy and Vim9 script in one file
Problem: Vim9: Not possible to use legacy and Vim9 script in one file.
Solution: Vim9: allow for "if false" before :vim9script. (closes https://github.com/vim/vim/issues/7851)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 17 Feb 2021 22:00:03 +0100 |
parents | 09bde146adcb |
children | 54b2aa1f0d42 |
comparison
equal
deleted
inserted
replaced
23973:5b97421c6d54 | 23974:d4f7e4138544 |
---|---|
2593 errormsg = ea.errmsg; | 2593 errormsg = ea.errmsg; |
2594 } | 2594 } |
2595 | 2595 |
2596 #ifdef FEAT_EVAL | 2596 #ifdef FEAT_EVAL |
2597 // Set flag that any command was executed, used by ex_vim9script(). | 2597 // Set flag that any command was executed, used by ex_vim9script(). |
2598 // Not if this was a command that wasn't executed or :endif. | |
2598 if (getline_equal(ea.getline, ea.cookie, getsourceline) | 2599 if (getline_equal(ea.getline, ea.cookie, getsourceline) |
2599 && current_sctx.sc_sid > 0) | 2600 && current_sctx.sc_sid > 0 |
2601 && ea.cmdidx != CMD_endif | |
2602 && (cstack->cs_idx < 0 | |
2603 || (cstack->cs_flags[cstack->cs_idx] & CSF_ACTIVE))) | |
2600 SCRIPT_ITEM(current_sctx.sc_sid)->sn_state = SN_STATE_HAD_COMMAND; | 2604 SCRIPT_ITEM(current_sctx.sc_sid)->sn_state = SN_STATE_HAD_COMMAND; |
2601 | 2605 |
2602 /* | 2606 /* |
2603 * If the command just executed called do_cmdline(), any throw or ":return" | 2607 * If the command just executed called do_cmdline(), any throw or ":return" |
2604 * or ":finish" encountered there must also check the cstack of the still | 2608 * or ":finish" encountered there must also check the cstack of the still |