comparison src/userfunc.c @ 19253:a8d2d3c8f0b3 v8.2.0185

patch 8.2.0185: Vim9 script: cannot use "if has()" to skip lines Commit: https://github.com/vim/vim/commit/a259d8d30bc289764925fc42db1dbe774f0bb3f8 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jan 31 20:10:50 2020 +0100 patch 8.2.0185: Vim9 script: cannot use "if has()" to skip lines Problem: Vim9 script: cannot use "if has()" to skip lines. Solution: Evaluate constant expression at runtime.
author Bram Moolenaar <Bram@vim.org>
date Fri, 31 Jan 2020 20:15:05 +0100
parents 77cd94083850
children 9fcdeaa18bd1
comparison
equal deleted inserted replaced
19252:2f4b2122c7d1 19253:a8d2d3c8f0b3
2689 indent += 2; 2689 indent += 2;
2690 } 2690 }
2691 } 2691 }
2692 } 2692 }
2693 2693
2694 // Check for ":append", ":change", ":insert". 2694 // Check for ":append", ":change", ":insert". Not for :def.
2695 p = skip_range(p, NULL); 2695 p = skip_range(p, NULL);
2696 if ((p[0] == 'a' && (!ASCII_ISALPHA(p[1]) || p[1] == 'p')) 2696 if (eap->cmdidx != CMD_def
2697 && ((p[0] == 'a' && (!ASCII_ISALPHA(p[1]) || p[1] == 'p'))
2697 || (p[0] == 'c' 2698 || (p[0] == 'c'
2698 && (!ASCII_ISALPHA(p[1]) || (p[1] == 'h' 2699 && (!ASCII_ISALPHA(p[1]) || (p[1] == 'h'
2699 && (!ASCII_ISALPHA(p[2]) || (p[2] == 'a' 2700 && (!ASCII_ISALPHA(p[2]) || (p[2] == 'a'
2700 && (STRNCMP(&p[3], "nge", 3) != 0 2701 && (STRNCMP(&p[3], "nge", 3) != 0
2701 || !ASCII_ISALPHA(p[6]))))))) 2702 || !ASCII_ISALPHA(p[6])))))))
2702 || (p[0] == 'i' 2703 || (p[0] == 'i'
2703 && (!ASCII_ISALPHA(p[1]) || (p[1] == 'n' 2704 && (!ASCII_ISALPHA(p[1]) || (p[1] == 'n'
2704 && (!ASCII_ISALPHA(p[2]) || (p[2] == 's')))))) 2705 && (!ASCII_ISALPHA(p[2])
2706 || (p[2] == 's'
2707 && (!ASCII_ISALPHA(p[3])
2708 || p[3] == 'e'))))))))
2705 skip_until = vim_strsave((char_u *)"."); 2709 skip_until = vim_strsave((char_u *)".");
2706 2710
2707 // Check for ":python <<EOF", ":tcl <<EOF", etc. 2711 // Check for ":python <<EOF", ":tcl <<EOF", etc.
2708 arg = skipwhite(skiptowhite(p)); 2712 arg = skipwhite(skiptowhite(p));
2709 if (arg[0] == '<' && arg[1] =='<' 2713 if (arg[0] == '<' && arg[1] =='<'