Skip to content

Commit f082a95

Browse files
authored
Merge pull request #2326 from h-east/update-builtin
Update builtin.{txt,jax}
2 parents 336ad0e + dfd3d72 commit f082a95

File tree

2 files changed

+70
-32
lines changed

2 files changed

+70
-32
lines changed

doc/builtin.jax

Lines changed: 35 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,8 @@ 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 チェックサ
636+
636637
shellescape({string} [, {special}])
637638
文字列 {string}をシェルコマンド引数として使う
638639
ためにエスケープする。
@@ -1965,10 +1966,10 @@ col({expr} [, {winid}]) *col()*
19651966

19661967

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

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

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

1011710134

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

1012110139
|method| としても使用できる: >
1012210140
GetText()->sha256()
10141+
GetBlob()->sha256()
1012310142
<
1012410143
戻り値の型: |String|
1012510144

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)