comparison src/userfunc.c @ 21685:26a4b53c4587 v8.2.1392

patch 8.2.1392: Vim9: line number incorrect after skipping over comment lines Commit: https://github.com/vim/vim/commit/bf8feb5aeb71c8f56897845c4134793201aa459a Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 8 14:26:31 2020 +0200 patch 8.2.1392: Vim9: line number incorrect after skipping over comment lines Problem: Vim9: error line number incorrect after skipping over comment lines. Solution: Insert empty lines for skipped lines.
author Bram Moolenaar <Bram@vim.org>
date Sat, 08 Aug 2020 14:30:04 +0200
parents a640bc762196
children 1b96535705a0
comparison
equal deleted inserted replaced
21684:70ae37685813 21685:26a4b53c4587
2959 } 2959 }
2960 2960
2961 // Save the starting line number. 2961 // Save the starting line number.
2962 sourcing_lnum_top = SOURCING_LNUM; 2962 sourcing_lnum_top = SOURCING_LNUM;
2963 2963
2964 // Detect having skipped over comment lines to find the return
2965 // type. Add NULL lines to keep the line count correct.
2966 sourcing_lnum_off = get_sourced_lnum(eap->getline, eap->cookie);
2967 if (SOURCING_LNUM < sourcing_lnum_off)
2968 {
2969 sourcing_lnum_off -= SOURCING_LNUM;
2970 if (ga_grow(&newlines, sourcing_lnum_off) == FAIL)
2971 goto erret;
2972 while (sourcing_lnum_off-- > 0)
2973 ((char_u **)(newlines.ga_data))[newlines.ga_len++] = NULL;
2974 }
2975
2964 indent = 2; 2976 indent = 2;
2965 nesting = 0; 2977 nesting = 0;
2966 nesting_def[nesting] = (eap->cmdidx == CMD_def); 2978 nesting_def[nesting] = (eap->cmdidx == CMD_def);
2967 for (;;) 2979 for (;;)
2968 { 2980 {