comparison src/highlight.c @ 18991:847cc7932c42 v8.2.0056

patch 8.2.0056: execution stack is incomplete and inefficient Commit: https://github.com/vim/vim/commit/1a47ae32cdc19b0fd5a82e19fe5fddf45db1a506 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Dec 29 23:04:25 2019 +0100 patch 8.2.0056: execution stack is incomplete and inefficient Problem: Execution stack is incomplete and inefficient. Solution: Introduce a proper execution stack and use it instead of sourcing_name/sourcing_lnum. Create a string only when used.
author Bram Moolenaar <Bram@vim.org>
date Sun, 29 Dec 2019 23:15:04 +0100
parents 30c965c6f855
children e7b4fff348dd
comparison
equal deleted inserted replaced
18990:1219ae40b086 18991:847cc7932c42
746 * for the group, unless '!' is used 746 * for the group, unless '!' is used
747 */ 747 */
748 if (to_id > 0 && !forceit && !init 748 if (to_id > 0 && !forceit && !init
749 && hl_has_settings(from_id - 1, dodefault)) 749 && hl_has_settings(from_id - 1, dodefault))
750 { 750 {
751 if (sourcing_name == NULL && !dodefault) 751 if (SOURCING_NAME == NULL && !dodefault)
752 emsg(_("E414: group has settings, highlight link ignored")); 752 emsg(_("E414: group has settings, highlight link ignored"));
753 } 753 }
754 else if (HL_TABLE()[from_id - 1].sg_link != to_id 754 else if (HL_TABLE()[from_id - 1].sg_link != to_id
755 #ifdef FEAT_EVAL 755 #ifdef FEAT_EVAL
756 || HL_TABLE()[from_id - 1].sg_script_ctx.sc_sid 756 || HL_TABLE()[from_id - 1].sg_script_ctx.sc_sid
761 if (!init) 761 if (!init)
762 HL_TABLE()[from_id - 1].sg_set |= SG_LINK; 762 HL_TABLE()[from_id - 1].sg_set |= SG_LINK;
763 HL_TABLE()[from_id - 1].sg_link = to_id; 763 HL_TABLE()[from_id - 1].sg_link = to_id;
764 #ifdef FEAT_EVAL 764 #ifdef FEAT_EVAL
765 HL_TABLE()[from_id - 1].sg_script_ctx = current_sctx; 765 HL_TABLE()[from_id - 1].sg_script_ctx = current_sctx;
766 HL_TABLE()[from_id - 1].sg_script_ctx.sc_lnum += sourcing_lnum; 766 HL_TABLE()[from_id - 1].sg_script_ctx.sc_lnum += SOURCING_LNUM;
767 #endif 767 #endif
768 HL_TABLE()[from_id - 1].sg_cleared = FALSE; 768 HL_TABLE()[from_id - 1].sg_cleared = FALSE;
769 redraw_all_later(SOME_VALID); 769 redraw_all_later(SOME_VALID);
770 770
771 // Only call highlight_changed() once after multiple changes. 771 // Only call highlight_changed() once after multiple changes.
1516 #endif 1516 #endif
1517 else 1517 else
1518 set_hl_attr(idx); 1518 set_hl_attr(idx);
1519 #ifdef FEAT_EVAL 1519 #ifdef FEAT_EVAL
1520 HL_TABLE()[idx].sg_script_ctx = current_sctx; 1520 HL_TABLE()[idx].sg_script_ctx = current_sctx;
1521 HL_TABLE()[idx].sg_script_ctx.sc_lnum += sourcing_lnum; 1521 HL_TABLE()[idx].sg_script_ctx.sc_lnum += SOURCING_LNUM;
1522 #endif 1522 #endif
1523 } 1523 }
1524 1524
1525 vim_free(key); 1525 vim_free(key);
1526 vim_free(arg); 1526 vim_free(arg);