comparison runtime/doc/builtin.txt @ 33383:5c12ca4dcd45 v9.0.1950

patch 9.0.1950: Vim9: error codes spread out Commit: https://github.com/vim/vim/commit/413f83990f15d5d59d27ab741670f527a7a3feb8 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Thu Sep 28 22:46:37 2023 +0200 patch 9.0.1950: Vim9: error codes spread out Problem: Vim9: error codes spread out Solution: group them together and reserve 100 more for future use Reserve 100 error codes for future enhancements to the Vim9 class support closes: #13207 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
author Christian Brabandt <cb@256bit.org>
date Thu, 28 Sep 2023 23:00:03 +0200
parents 472bf147d4ed
children dcfbfe57141c
comparison
equal deleted inserted replaced
33382:0ca269de511d 33383:5c12ca4dcd45
6828 echo printf("%1$*2$.4f", 1.4142135, 6) 6828 echo printf("%1$*2$.4f", 1.4142135, 6)
6829 < 1.4142 > 6829 < 1.4142 >
6830 echo printf("%1$*2$.*3$f", 1.4142135, 6, 2) 6830 echo printf("%1$*2$.*3$f", 1.4142135, 6, 2)
6831 < 1.41 6831 < 1.41
6832 6832
6833 *E1400* 6833 *E1500*
6834 You cannot mix positional and non-positional arguments: > 6834 You cannot mix positional and non-positional arguments: >
6835 echo printf("%s%1$s", "One", "Two") 6835 echo printf("%s%1$s", "One", "Two")
6836 < E1400: Cannot mix positional and non-positional 6836 < E1500: Cannot mix positional and non-positional
6837 arguments: %s%1$s 6837 arguments: %s%1$s
6838 6838
6839 *E1401* 6839 *E1501*
6840 You cannot skip a positional argument in a format string: > 6840 You cannot skip a positional argument in a format string: >
6841 echo printf("%3$s%1$s", "One", "Two", "Three") 6841 echo printf("%3$s%1$s", "One", "Two", "Three")
6842 < E1401: format argument 2 unused in $-style 6842 < E1501: format argument 2 unused in $-style
6843 format: %3$s%1$s 6843 format: %3$s%1$s
6844 6844
6845 *E1402* 6845 *E1502*
6846 You can re-use a [field-width] (or [precision]) argument: > 6846 You can re-use a [field-width] (or [precision]) argument: >
6847 echo printf("%1$d at width %2$d is: %01$*2$d", 1, 2) 6847 echo printf("%1$d at width %2$d is: %01$*2$d", 1, 2)
6848 < 1 at width 2 is: 01 6848 < 1 at width 2 is: 01
6849 6849
6850 However, you can't use it as a different type: > 6850 However, you can't use it as a different type: >
6851 echo printf("%1$d at width %2$ld is: %01$*2$d", 1, 2) 6851 echo printf("%1$d at width %2$ld is: %01$*2$d", 1, 2)
6852 < E1402: Positional argument 2 used as field 6852 < E1502: Positional argument 2 used as field
6853 width reused as different type: long int/int 6853 width reused as different type: long int/int
6854 6854
6855 *E1403* 6855 *E1503*
6856 When a positional argument is used, but not the correct number 6856 When a positional argument is used, but not the correct number
6857 or arguments is given, an error is raised: > 6857 or arguments is given, an error is raised: >
6858 echo printf("%1$d at width %2$d is: %01$*2$.*3$d", 1, 2) 6858 echo printf("%1$d at width %2$d is: %01$*2$.*3$d", 1, 2)
6859 < E1403: Positional argument 3 out of bounds: 6859 < E1503: Positional argument 3 out of bounds:
6860 %1$d at width %2$d is: %01$*2$.*3$d 6860 %1$d at width %2$d is: %01$*2$.*3$d
6861 6861
6862 Only the first error is reported: > 6862 Only the first error is reported: >
6863 echo printf("%01$*2$.*3$d %4$d", 1, 2) 6863 echo printf("%01$*2$.*3$d %4$d", 1, 2)
6864 < E1403: Positional argument 3 out of bounds: 6864 < E1503: Positional argument 3 out of bounds:
6865 %01$*2$.*3$d %4$d 6865 %01$*2$.*3$d %4$d
6866 6866
6867 *E1404* 6867 *E1504*
6868 A positional argument can be used more than once: > 6868 A positional argument can be used more than once: >
6869 echo printf("%1$s %2$s %1$s", "One", "Two") 6869 echo printf("%1$s %2$s %1$s", "One", "Two")
6870 < One Two One 6870 < One Two One
6871 6871
6872 However, you can't use a different type the second time: > 6872 However, you can't use a different type the second time: >
6873 echo printf("%1$s %2$s %1$d", "One", "Two") 6873 echo printf("%1$s %2$s %1$d", "One", "Two")
6874 < E1404: Positional argument 1 type used 6874 < E1504: Positional argument 1 type used
6875 inconsistently: int/string 6875 inconsistently: int/string
6876 6876
6877 *E1405* 6877 *E1505*
6878 Various other errors that lead to a format string being 6878 Various other errors that lead to a format string being
6879 wrongly formatted lead to: > 6879 wrongly formatted lead to: >
6880 echo printf("%1$d at width %2$d is: %01$*2$.3$d", 1, 2) 6880 echo printf("%1$d at width %2$d is: %01$*2$.3$d", 1, 2)
6881 < E1405: Invalid format specifier: 6881 < E1505: Invalid format specifier:
6882 %1$d at width %2$d is: %01$*2$.3$d 6882 %1$d at width %2$d is: %01$*2$.3$d
6883 6883
6884 prompt_getprompt({buf}) *prompt_getprompt()* 6884 prompt_getprompt({buf}) *prompt_getprompt()*
6885 Returns the effective prompt text for buffer {buf}. {buf} can 6885 Returns the effective prompt text for buffer {buf}. {buf} can
6886 be a buffer name or number. See |prompt-buffer|. 6886 be a buffer name or number. See |prompt-buffer|.