aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/tag.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-08-01 12:17:39 -0400
committerGitHub <noreply@github.com>2021-08-01 12:17:39 -0400
commit337b1b31ac12ee4351668e32fe116282efd3dcc3 (patch)
tree1c9c98a10406590e5d65a9500664e600d7c45d32 /src/nvim/tag.c
parent51251e1dc74ce17bb083c002c2e5d5b34ce4e402 (diff)
parentde74fcc74cee4e4b35335bff6cecea46f36a78f6 (diff)
downloadrneovim-337b1b31ac12ee4351668e32fe116282efd3dcc3.tar.gz
rneovim-337b1b31ac12ee4351668e32fe116282efd3dcc3.tar.bz2
rneovim-337b1b31ac12ee4351668e32fe116282efd3dcc3.zip
Merge pull request #15234 from janlazo/vim-8.2.3164
vim-patch:8.2.{3164,3167,3192,3208,3213,3214,3225,3231,3243,3246,3247,3250,3253,3256,3260}
Diffstat (limited to 'src/nvim/tag.c')
-rw-r--r--src/nvim/tag.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/nvim/tag.c b/src/nvim/tag.c
index a236adee06..d6c6b064b2 100644
--- a/src/nvim/tag.c
+++ b/src/nvim/tag.c
@@ -2611,7 +2611,6 @@ static int jumpto_tag(
int keep_help // keep help flag (FALSE for cscope)
)
{
- int save_secure;
int save_magic;
bool save_p_ws;
int save_p_scs, save_p_ic;
@@ -2766,9 +2765,6 @@ static int jumpto_tag(
curwin->w_set_curswant = true;
postponed_split = 0;
- save_secure = secure;
- secure = 1;
- ++sandbox;
save_magic = p_magic;
p_magic = false; // always execute with 'nomagic'
// Save value of no_hlsearch, jumping to a tag is not a real search
@@ -2866,21 +2862,26 @@ static int jumpto_tag(
* of the line. May need to correct that here. */
check_cursor();
} else {
- curwin->w_cursor.lnum = 1; /* start command in line 1 */
+ const int save_secure = secure;
+
+ // Setup the sandbox for executing the command from the tags file.
+ secure = 1;
+ sandbox++;
+ curwin->w_cursor.lnum = 1; // start command in line 1
do_cmdline_cmd((char *)pbuf);
retval = OK;
+
+ // When the command has done something that is not allowed make sure
+ // the error message can be seen.
+ if (secure == 2) {
+ wait_return(true);
+ }
+ secure = save_secure;
+ sandbox--;
}
- /*
- * When the command has done something that is not allowed make sure
- * the error message can be seen.
- */
- if (secure == 2)
- wait_return(TRUE);
- secure = save_secure;
p_magic = save_magic;
- --sandbox;
- /* restore no_hlsearch when keeping the old search pattern */
+ // restore no_hlsearch when keeping the old search pattern
if (search_options) {
set_no_hlsearch(save_no_hlsearch);
}