comparison src/usercmd.c @ 26103:d079ab2ba260 v8.2.3584

patch 8.2.3584: "verbose set efm" reports location of the :compiler command Commit: https://github.com/vim/vim/commit/58ef8a31d7087d495ab1582be5b7a22796ac2451 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Nov 12 11:25:11 2021 +0000 patch 8.2.3584: "verbose set efm" reports location of the :compiler command Problem: "verbose set efm" reports the location of the :compiler command. (Gary Johnson) Solution: Add the "-keepscript" argument to :command and use it when defining CompilerSet.
author Bram Moolenaar <Bram@vim.org>
date Fri, 12 Nov 2021 12:30:05 +0100
parents 60e4892dfa45
children 41b3718d84c3
comparison
equal deleted inserted replaced
26102:eeb8654235f6 26103:d079ab2ba260
358 char_u * 358 char_u *
359 get_user_cmd_flags(expand_T *xp UNUSED, int idx) 359 get_user_cmd_flags(expand_T *xp UNUSED, int idx)
360 { 360 {
361 static char *user_cmd_flags[] = { 361 static char *user_cmd_flags[] = {
362 "addr", "bang", "bar", "buffer", "complete", 362 "addr", "bang", "bar", "buffer", "complete",
363 "count", "nargs", "range", "register" 363 "count", "nargs", "range", "register", "keepscript"
364 }; 364 };
365 365
366 if (idx >= (int)ARRAY_LENGTH(user_cmd_flags)) 366 if (idx >= (int)ARRAY_LENGTH(user_cmd_flags))
367 return NULL; 367 return NULL;
368 return (char_u *)user_cmd_flags[idx]; 368 return (char_u *)user_cmd_flags[idx];
733 *argt |= EX_BANG; 733 *argt |= EX_BANG;
734 else if (STRNICMP(attr, "buffer", len) == 0) 734 else if (STRNICMP(attr, "buffer", len) == 0)
735 *flags |= UC_BUFFER; 735 *flags |= UC_BUFFER;
736 else if (STRNICMP(attr, "register", len) == 0) 736 else if (STRNICMP(attr, "register", len) == 0)
737 *argt |= EX_REGSTR; 737 *argt |= EX_REGSTR;
738 else if (STRNICMP(attr, "keepscript", len) == 0)
739 *argt |= EX_KEEPSCRIPT;
738 else if (STRNICMP(attr, "bar", len) == 0) 740 else if (STRNICMP(attr, "bar", len) == 0)
739 *argt |= EX_TRLBAR; 741 *argt |= EX_TRLBAR;
740 else 742 else
741 { 743 {
742 int i; 744 int i;
1762 vim_free(split_buf); 1764 vim_free(split_buf);
1763 return; 1765 return;
1764 } 1766 }
1765 } 1767 }
1766 1768
1767 current_sctx.sc_version = cmd->uc_script_ctx.sc_version; 1769 if ((cmd->uc_argt & EX_KEEPSCRIPT) == 0)
1770 {
1771 current_sctx.sc_version = cmd->uc_script_ctx.sc_version;
1768 #ifdef FEAT_EVAL 1772 #ifdef FEAT_EVAL
1769 current_sctx.sc_sid = cmd->uc_script_ctx.sc_sid; 1773 current_sctx.sc_sid = cmd->uc_script_ctx.sc_sid;
1770 #endif 1774 #endif
1775 }
1771 (void)do_cmdline(buf, eap->getline, eap->cookie, 1776 (void)do_cmdline(buf, eap->getline, eap->cookie,
1772 DOCMD_VERBOSE|DOCMD_NOWAIT|DOCMD_KEYTYPED); 1777 DOCMD_VERBOSE|DOCMD_NOWAIT|DOCMD_KEYTYPED);
1773 current_sctx = save_current_sctx; 1778 if ((cmd->uc_argt & EX_KEEPSCRIPT) == 0)
1779 current_sctx = save_current_sctx;
1774 vim_free(buf); 1780 vim_free(buf);
1775 vim_free(split_buf); 1781 vim_free(split_buf);
1776 } 1782 }