Skip to content

Commit 73e473f

Browse files
committed
Update builtin.{txt,jax}
1 parent ec8ba50 commit 73e473f

File tree

2 files changed

+69
-32
lines changed

2 files changed

+69
-32
lines changed

doc/builtin.jax

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*builtin.txt* For Vim バージョン 9.1. Last change: 2025 Sep 08
1+
*builtin.txt* For Vim バージョン 9.1. Last change: 2025 Sep 18
22

33

44
VIMリファレンスマニュアル by Bram Moolenaar
@@ -632,7 +632,7 @@ settagstack({nr}, {dict} [, {action}])
632632
数値 {dict}を使ってタグスタックを変更
633633
setwinvar({nr}, {varname}, {val}) なし ウィンドウ{nr}の変数{varname}に{val}を
634634
セット
635-
sha256({string}) 文字列 {string}のSHA256チェックサム
635+
sha256({expr}) 文字列 文字列または Blob のSHA256チェックサム
636636
shellescape({string} [, {special}])
637637
文字列 {string}をシェルコマンド引数として使う
638638
ためにエスケープする。
@@ -1965,10 +1965,10 @@ col({expr} [, {winid}]) *col()*
19651965

19661966

19671967
complete({startcol}, {matches}) *complete()* *E785*
1968-
挿入モード補完の候補を設定する
1969-
挿入モードでのみ使用できる。CTRL-R = (|i_CTRL-R| を参照)と組み
1970-
合わせてマッピングを作る必要がある。CTRL-Oの後や、<expr>マッピ
1971-
ングの中では正しく動作しない
1968+
挿入モード補完のマッチを設定する。挿入モードでのみ使用できる
1969+
通常は CTRL-R = (|i_CTRL-R| を参照) のマッピングから呼び出され
1970+
る。ただし、|<Cmd>| または |<ScriptCmd>| マッピングからも呼び
1971+
出される。CTRL-O の後や式のマッピングでは機能しない
19721972
{startcol}は補完すべき単語の開始位置を示す、行内のバイトオフセッ
19731973
トである。その位置からカーソルまでのテキストが補完すべき単語と
19741974
なる。
@@ -1981,15 +1981,31 @@ complete({startcol}, {matches}) *complete()* *E785*
19811981
この関数で設定した候補は普通の挿入モード補完と同じ様にCTRL-Nと
19821982
CTRL-Pで選択できる。設定されていればポップアップメニューが表示
19831983
される。|ins-completion-menu|を参照。
1984-
例: >
1985-
inoremap <F5> <C-R>=ListMonths()<CR>
19861984

1987-
func ListMonths()
1988-
call complete(col('.'), ['January', 'February', 'March',
1989-
\ 'April', 'May', 'June', 'July', 'August', 'September',
1990-
\ 'October', 'November', 'December'])
1991-
return ''
1992-
endfunc
1985+
例 (旧来の Vim script を使用): >
1986+
1987+
inoremap <F5> <C-R>=ListMonths()<CR>
1988+
1989+
func ListMonths()
1990+
call complete(col('.'), ['January', 'February', 'March',
1991+
\ 'April', 'May', 'June', 'July', 'August',
1992+
\ 'September', \ 'October', 'November', 'December'])
1993+
return ''
1994+
endfunc
1995+
<
1996+
例 (Vim9 script を使用): >
1997+
1998+
vim9script
1999+
def ListMonths(): string
2000+
const months = [ 'January', 'February', 'March', 'April',
2001+
'May', 'June', 'July', 'September', 'October',
2002+
'November', 'December']
2003+
complete(col('.'), months)
2004+
return ''
2005+
enddef
2006+
2007+
inoremap <F5> <ScriptCmd>ListMonths()<CR>
2008+
19932009
< この例はそれほど役には立たないが、使い方を示している。Note 0が
19942010
挿入されてしまわないように空文字列を返していることに注意。
19952011

@@ -10115,11 +10131,13 @@ setwinvar({winnr}, {varname}, {val}) *setwinvar()*
1011510131
戻り値の型: |Number|
1011610132

1011710133

10118-
sha256({string}) *sha256()*
10119-
{string}のSHA256チェックサムを64文字の16進文字列で返す。
10134+
sha256({expr}) *sha256()*
10135+
{expr} のSHA256チェックサムを64文字の16進文字列で返す。
10136+
{expr} は文字列または Blob である。
1012010137

1012110138
|method| としても使用できる: >
1012210139
GetText()->sha256()
10140+
GetBlob()->sha256()
1012310141
<
1012410142
戻り値の型: |String|
1012510143

en/builtin.txt

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*builtin.txt* For Vim version 9.1. Last change: 2025 Sep 08
1+
*builtin.txt* For Vim version 9.1. Last change: 2025 Sep 18
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -575,7 +575,7 @@ settabwinvar({tabnr}, {winnr}, {varname}, {val})
575575
settagstack({nr}, {dict} [, {action}])
576576
Number modify tag stack using {dict}
577577
setwinvar({nr}, {varname}, {val}) none set {varname} in window {nr} to {val}
578-
sha256({string}) String SHA256 checksum of {string}
578+
sha256({expr}) String SHA256 checksum of String or Blob
579579
shellescape({string} [, {special}])
580580
String escape {string} for use as shell
581581
command argument
@@ -1913,10 +1913,11 @@ col({expr} [, {winid}]) *col()*
19131913

19141914

19151915
complete({startcol}, {matches}) *complete()* *E785*
1916-
Set the matches for Insert mode completion.
1917-
Can only be used in Insert mode. You need to use a mapping
1918-
with CTRL-R = (see |i_CTRL-R|). It does not work after CTRL-O
1919-
or with an expression mapping.
1916+
Set the matches for Insert mode completion. Can only be
1917+
used in Insert mode. Typically invoked from a mapping with
1918+
CTRL-R = (see |i_CTRL-R|), but may also be called from a
1919+
|<Cmd>| or |<ScriptCmd>| mapping. It does not work after
1920+
CTRL-O or with an expression mapping.
19201921
{startcol} is the byte offset in the line where the completed
19211922
text start. The text up to the cursor is the original text
19221923
that will be replaced by the matches. Use col('.') for an
@@ -1930,15 +1931,31 @@ complete({startcol}, {matches}) *complete()* *E785*
19301931
The match can be selected with CTRL-N and CTRL-P as usual with
19311932
Insert mode completion. The popup menu will appear if
19321933
specified, see |ins-completion-menu|.
1933-
Example: >
1934-
inoremap <F5> <C-R>=ListMonths()<CR>
19351934

1936-
func ListMonths()
1937-
call complete(col('.'), ['January', 'February', 'March',
1938-
\ 'April', 'May', 'June', 'July', 'August', 'September',
1939-
\ 'October', 'November', 'December'])
1940-
return ''
1941-
endfunc
1935+
Example (using legacy Vim script): >
1936+
1937+
inoremap <F5> <C-R>=ListMonths()<CR>
1938+
1939+
func ListMonths()
1940+
call complete(col('.'), ['January', 'February', 'March',
1941+
\ 'April', 'May', 'June', 'July', 'August',
1942+
\ 'September', \ 'October', 'November', 'December'])
1943+
return ''
1944+
endfunc
1945+
<
1946+
Example (using Vim9 script): >
1947+
1948+
vim9script
1949+
def ListMonths(): string
1950+
const months = [ 'January', 'February', 'March', 'April',
1951+
'May', 'June', 'July', 'September', 'October',
1952+
'November', 'December']
1953+
complete(col('.'), months)
1954+
return ''
1955+
enddef
1956+
1957+
inoremap <F5> <ScriptCmd>ListMonths()<CR>
1958+
19421959
< This isn't very useful, but it shows how it works. Note that
19431960
an empty string is returned to avoid a zero being inserted.
19441961

@@ -10319,12 +10336,14 @@ setwinvar({winnr}, {varname}, {val}) *setwinvar()*
1031910336
Return type: |Number|
1032010337

1032110338

10322-
sha256({string}) *sha256()*
10339+
sha256({expr}) *sha256()*
1032310340
Returns a String with 64 hex characters, which is the SHA256
10324-
checksum of {string}.
10341+
checksum of {expr}.
10342+
{expr} is a String or a Blob.
1032510343

1032610344
Can also be used as a |method|: >
1032710345
GetText()->sha256()
10346+
GetBlob()->sha256()
1032810347
<
1032910348
Return type: |String|
1033010349

0 commit comments

Comments
 (0)