Mercurial > vim
comparison src/ex_docmd.c @ 24369:a97fb00978f6 v8.2.2725
patch 8.2.2725: Vim9: message about compiling is wrong when using try/catch
Commit: https://github.com/vim/vim/commit/e8c4660a55364a5d3e395652d1202b8702666823
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Apr 5 22:27:37 2021 +0200
patch 8.2.2725: Vim9: message about compiling is wrong when using try/catch
Problem: Vim9: message about compiling is wrong when using try/catch.
Solution: Store the compiling flag with the message. (closes https://github.com/vim/vim/issues/8071)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 05 Apr 2021 22:45:27 +0200 |
parents | b471a413d36a |
children | 9299d21d1d5d |
comparison
equal
deleted
inserted
replaced
24368:4bf6a466ef7d | 24369:a97fb00978f6 |
---|---|
1264 * commands are executed. | 1264 * commands are executed. |
1265 */ | 1265 */ |
1266 if (did_throw) | 1266 if (did_throw) |
1267 { | 1267 { |
1268 char *p = NULL; | 1268 char *p = NULL; |
1269 msglist_T *messages = NULL, *next; | 1269 msglist_T *messages = NULL; |
1270 | 1270 |
1271 /* | 1271 /* |
1272 * If the uncaught exception is a user exception, report it as an | 1272 * If the uncaught exception is a user exception, report it as an |
1273 * error. If it is an error exception, display the saved error | 1273 * error. If it is an error exception, display the saved error |
1274 * message now. For an interrupt exception, do nothing; the | 1274 * message now. For an interrupt exception, do nothing; the |
1301 | 1301 |
1302 if (messages != NULL) | 1302 if (messages != NULL) |
1303 { | 1303 { |
1304 do | 1304 do |
1305 { | 1305 { |
1306 next = messages->next; | 1306 msglist_T *next = messages->next; |
1307 int save_compiling = estack_compiling; | |
1308 | |
1309 estack_compiling = messages->msg_compiling; | |
1307 emsg(messages->msg); | 1310 emsg(messages->msg); |
1308 vim_free(messages->msg); | 1311 vim_free(messages->msg); |
1309 vim_free(messages->sfile); | 1312 vim_free(messages->sfile); |
1310 vim_free(messages); | 1313 vim_free(messages); |
1311 messages = next; | 1314 messages = next; |
1315 estack_compiling = save_compiling; | |
1312 } | 1316 } |
1313 while (messages != NULL); | 1317 while (messages != NULL); |
1314 } | 1318 } |
1315 else if (p != NULL) | 1319 else if (p != NULL) |
1316 { | 1320 { |