Mercurial > vim
comparison src/ex_getln.c @ 14700:0a3b9ecf7cb8 v8.1.0362
patch 8.1.0362: cannot get the script line number when executing a function
commit https://github.com/vim/vim/commit/f29c1c6aa3f365c025890fab5fb9efbe88eb1761
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Sep 10 21:05:02 2018 +0200
patch 8.1.0362: cannot get the script line number when executing a function
Problem: Cannot get the script line number when executing a function.
Solution: Store the line number besides the script ID. (Ozaki Kiichi,
closes #3362) Also display the line number with ":verbose set".
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 10 Sep 2018 21:15:07 +0200 |
parents | 2982a54aa304 |
children | fd69edd2c67e |
comparison
equal
deleted
inserted
replaced
14699:2d2a36710dad | 14700:0a3b9ecf7cb8 |
---|---|
5589 int *num_file, | 5589 int *num_file, |
5590 char_u ***file) | 5590 char_u ***file) |
5591 { | 5591 { |
5592 int keep = 0; | 5592 int keep = 0; |
5593 typval_T args[4]; | 5593 typval_T args[4]; |
5594 int save_current_SID = current_SID; | 5594 sctx_T save_current_sctx = current_sctx; |
5595 char_u *pat = NULL; | 5595 char_u *pat = NULL; |
5596 void *ret; | 5596 void *ret; |
5597 struct cmdline_info save_ccline; | 5597 struct cmdline_info save_ccline; |
5598 | 5598 |
5599 if (xp->xp_arg == NULL || xp->xp_arg[0] == '\0' || xp->xp_line == NULL) | 5599 if (xp->xp_arg == NULL || xp->xp_arg[0] == '\0' || xp->xp_line == NULL) |
5619 | 5619 |
5620 /* Save the cmdline, we don't know what the function may do. */ | 5620 /* Save the cmdline, we don't know what the function may do. */ |
5621 save_ccline = ccline; | 5621 save_ccline = ccline; |
5622 ccline.cmdbuff = NULL; | 5622 ccline.cmdbuff = NULL; |
5623 ccline.cmdprompt = NULL; | 5623 ccline.cmdprompt = NULL; |
5624 current_SID = xp->xp_scriptID; | 5624 current_sctx = xp->xp_script_ctx; |
5625 | 5625 |
5626 ret = user_expand_func(xp->xp_arg, 3, args); | 5626 ret = user_expand_func(xp->xp_arg, 3, args); |
5627 | 5627 |
5628 ccline = save_ccline; | 5628 ccline = save_ccline; |
5629 current_SID = save_current_SID; | 5629 current_sctx = save_current_sctx; |
5630 if (ccline.cmdbuff != NULL) | 5630 if (ccline.cmdbuff != NULL) |
5631 ccline.cmdbuff[ccline.cmdlen] = keep; | 5631 ccline.cmdbuff[ccline.cmdlen] = keep; |
5632 | 5632 |
5633 vim_free(pat); | 5633 vim_free(pat); |
5634 return ret; | 5634 return ret; |