Skip to content
This repository was archived by the owner on Feb 25, 2024. It is now read-only.

Commit 8f71f45

Browse files
1 parent 067e830 commit 8f71f45

File tree

1 file changed

+51
-51
lines changed

1 file changed

+51
-51
lines changed

doc/builtin.jax

+51-51
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*builtin.txt* For Vim バージョン 9.0. Last change: 2023 Sep 27
1+
*builtin.txt* For Vim バージョン 9.0. Last change: 2023 Nov 20
22

33

44
VIMリファレンスマニュアル by Bram Moolenaar
@@ -6654,94 +6654,94 @@ printf({fmt}, {expr1} ...) *printf()*
66546654
異なる翻訳に対応するために、位置引数を使用してこれを示すことが
66556655
できる。例えば: >
66566656

6657-
#, c-format
6658-
msgid "%s returning %s"
6659-
msgstr "waarde %2$s komt terug van %1$s"
6657+
#, c-format
6658+
msgid "%s returning %s"
6659+
msgstr "waarde %2$s komt terug van %1$s"
66606660
<
66616661
この例では、2 つの文字列引数を逆にした文が出力されている。 >
66626662

6663-
echo printf(
6664-
"In The Netherlands, vim's creator's name is: %1$s %2$s",
6665-
"Bram", "Moolenaar")
6666-
< オランダ語では、vim's creator's name is: Bram Moolenaar >
6663+
echo printf(
6664+
"In The Netherlands, vim's creator's name is: %1$s %2$s",
6665+
"Bram", "Moolenaar")
6666+
< オランダ語では、vim's creator's name is: Bram Moolenaar >
66676667

6668-
echo printf(
6669-
"In Belgium, vim's creator's name is: %2$s %1$s",
6670-
"Bram", "Moolenaar")
6671-
< ベルギー語では、vim's creator's name is: Moolenaar Bram
6668+
echo printf(
6669+
"In Belgium, vim's creator's name is: %2$s %1$s",
6670+
"Bram", "Moolenaar")
6671+
< ベルギー語では、vim's creator's name is: Moolenaar Bram
66726672

66736673
幅 (および精度) は、'*' 指定子を使用して指定できる。この場合、
66746674
引数リストでフィールド幅の位置を指定する必要がある。 >
66756675

6676-
echo printf("%1$*2$.*3$d", 1, 2, 3)
6677-
< 001 >
6678-
echo printf("%2$*3$.*1$d", 1, 2, 3)
6679-
< 2 >
6680-
echo printf("%3$*1$.*2$d", 1, 2, 3)
6681-
< 03 >
6682-
echo printf("%1$*2$.*3$g", 1.4142, 2, 3)
6683-
< 1.414
6676+
echo printf("%1$*2$.*3$d", 1, 2, 3)
6677+
< 001 >
6678+
echo printf("%2$*3$.*1$d", 1, 2, 3)
6679+
< 2 >
6680+
echo printf("%3$*1$.*2$d", 1, 2, 3)
6681+
< 03 >
6682+
echo printf("%1$*2$.*3$g", 1.4142, 2, 3)
6683+
< 1.414
66846684

66856685
幅や精度を直接指定することと、位置引数を介して指定することを組
66866686
み合わせることができます: >
66876687

6688-
echo printf("%1$4.*2$f", 1.4142135, 6)
6689-
< 1.414214 >
6690-
echo printf("%1$*2$.4f", 1.4142135, 6)
6691-
< 1.4142 >
6692-
echo printf("%1$*2$.*3$f", 1.4142135, 6, 2)
6693-
< 1.41
6688+
echo printf("%1$4.*2$f", 1.4142135, 6)
6689+
< 1.414214 >
6690+
echo printf("%1$*2$.4f", 1.4142135, 6)
6691+
< 1.4142 >
6692+
echo printf("%1$*2$.*3$f", 1.4142135, 6, 2)
6693+
< 1.41
66946694

66956695
*E1500*
66966696
位置引数と非位置引数を混在させることはできない: >
6697-
echo printf("%s%1$s", "One", "Two")
6698-
< E1500: Cannot mix positional and non-positional
6699-
arguments: %s%1$s
6697+
echo printf("%s%1$s", "One", "Two")
6698+
< E1500: Cannot mix positional and non-positional arguments:
6699+
%s%1$s
67006700

67016701
*E1501*
67026702
フォーマット文字列内の位置引数をスキップすることはできない: >
6703-
echo printf("%3$s%1$s", "One", "Two", "Three")
6704-
< E1501: format argument 2 unused in $-style
6705-
format: %3$s%1$s
6703+
echo printf("%3$s%1$s", "One", "Two", "Three")
6704+
< E1501: format argument 2 unused in $-style format:
6705+
%3$s%1$s
67066706

67076707
*E1502*
67086708
[field-width] (または [precision]) 引数を再利用できる: >
6709-
echo printf("%1$d at width %2$d is: %01$*2$d", 1, 2)
6710-
< 1 at width 2 is: 01
6709+
echo printf("%1$d at width %2$d is: %01$*2$d", 1, 2)
6710+
< 1 at width 2 is: 01
67116711

67126712
ただし、別の型として使用することはできない: >
6713-
echo printf("%1$d at width %2$ld is: %01$*2$d", 1, 2)
6714-
< E1502: Positional argument 2 used as field
6715-
width reused as different type: long int/int
6713+
echo printf("%1$d at width %2$ld is: %01$*2$d", 1, 2)
6714+
< E1502: Positional argument 2 used as field width reused as
6715+
different type: long int/int
67166716

67176717
*E1503*
67186718
位置引数が使用されているが、正しい数値または引数が指定されてい
67196719
ない場合、エラーが発生する: >
6720-
echo printf("%1$d at width %2$d is: %01$*2$.*3$d", 1, 2)
6721-
< E1503: Positional argument 3 out of bounds:
6722-
%1$d at width %2$d is: %01$*2$.*3$d
6720+
echo printf("%1$d at width %2$d is: %01$*2$.*3$d", 1, 2)
6721+
< E1503: Positional argument 3 out of bounds: %1$d at width
6722+
%2$d is: %01$*2$.*3$d
67236723

67246724
最初のエラーだけが報告される: >
6725-
echo printf("%01$*2$.*3$d %4$d", 1, 2)
6726-
< E1503: Positional argument 3 out of bounds:
6727-
%01$*2$.*3$d %4$d
6725+
echo printf("%01$*2$.*3$d %4$d", 1, 2)
6726+
< E1503: Positional argument 3 out of bounds: %01$*2$.*3$d
6727+
%4$d
67286728

67296729
*E1504*
67306730
位置引数は複数回使用できる: >
6731-
echo printf("%1$s %2$s %1$s", "One", "Two")
6732-
< One Two One
6731+
echo printf("%1$s %2$s %1$s", "One", "Two")
6732+
< One Two One
67336733

67346734
ただし、2 回目には別の型を使用することはできない: >
6735-
echo printf("%1$s %2$s %1$d", "One", "Two")
6736-
< E1504: Positional argument 1 type used
6737-
inconsistently: int/string
6735+
echo printf("%1$s %2$s %1$d", "One", "Two")
6736+
< E1504: Positional argument 1 type used inconsistently:
6737+
int/string
67386738

67396739
*E1505*
67406740
フォーマット文字列が誤ってフォーマットされることにつながる他の
67416741
さまざまなエラーは、以下のようなものである: >
6742-
echo printf("%1$d at width %2$d is: %01$*2$.3$d", 1, 2)
6743-
< E1505: Invalid format specifier:
6744-
%1$d at width %2$d is: %01$*2$.3$d
6742+
echo printf("%1$d at width %2$d is: %01$*2$.3$d", 1, 2)
6743+
< E1505: Invalid format specifier: %1$d at width %2$d is:
6744+
%01$*2$.3$d
67456745

67466746
*E1507*
67476747
この内部エラーは、位置形式引数を解析するロジックで、他の方法で

0 commit comments

Comments
 (0)