diff --git a/doc/builtin.jax b/doc/builtin.jax index 57ccffe30..f8c693680 100644 --- a/doc/builtin.jax +++ b/doc/builtin.jax @@ -1,4 +1,4 @@ -*builtin.txt* For Vim バージョン 9.1. Last change: 2025 Dec 21 +*builtin.txt* For Vim バージョン 9.1. Last change: 2026 Jan 03 VIM リファレンスマニュアル by Bram Moolenaar @@ -4827,6 +4827,10 @@ getpos({expr}) *getpos()* 桁番号は行内のバイト位置のリストとして返される。行内の文字での 位置を取得するなら、|getcharpos()| を使う。 + ビジュアルマーク |'<| と |'>| は、バッファを基準とした視覚的な + 選択範囲の開始と終了を表す。Note これはカーソル位置を基準とす + る |setpos()| とは異なることに注意。 + Note: ビジュアルモードの '< と '> について: ビジュアルモードが "V" (行選択モード) のとき、'< の桁番号はゼロ、'> の桁番号は大 きな値として |v:maxcol| と同値になる。 @@ -9933,8 +9937,13 @@ setpos({expr}, {list}) *setpos()* は優先値は設定されない。マークの位置を設定するときに "curswant" を指定した場合はその値は使用されない。 - Note: '< と '> の行番号を変更した場合は '< が '> の手前にくる - ように位置が交換される。 + Note |'<| と |'>| の場合、行番号を変更するとマークが実質的に入 + れ替わり、|'<| が常に |'>| の前になることに注意。 + + ビジュアルマーク |'<| と |'>| は、カーソル位置を基準とした視覚 + 的な選択範囲の開始と終了を参照する。 + Note これは、バッファを基準とする |getpos()| とは異なることに + 注意。 位置をセットできたときは 0 を、そうでなければ -1 を返す。 {expr} が無効なときはエラーメッセージが出る。 diff --git a/en/builtin.txt b/en/builtin.txt index d149f0a19..c3364d4fb 100644 --- a/en/builtin.txt +++ b/en/builtin.txt @@ -1,4 +1,4 @@ -*builtin.txt* For Vim version 9.1. Last change: 2025 Dec 21 +*builtin.txt* For Vim version 9.1. Last change: 2026 Jan 03 VIM REFERENCE MANUAL by Bram Moolenaar @@ -4879,6 +4879,11 @@ getpos({expr}) *getpos()* within the line. To get the character position in the line, use |getcharpos()|. + The visual marks |'<| and |'>| refer to the beginning and end + of the visual selection relative to the buffer. Note that + this differs from |setpos()|, where they are relative to the + cursor position. + Note that for '< and '> Visual mode matters: when it is "V" (visual line mode) the column of '< is zero and the column of '> is a large number equal to |v:maxcol|. @@ -10152,9 +10157,14 @@ setpos({expr}, {list}) *setpos()* preferred column is not set. When it is present and setting a mark position it is not used. - Note that for '< and '> changing the line number may result in - the marks to be effectively be swapped, so that '< is always - before '>. + Note that for |'<| and |'>| changing the line number may + result in the marks to be effectively swapped, so that |'<| is + always before |'>|. + + The visual marks |'<| and |'>| refer to the beginning and end + of the visual selection relative to the cursor position. + Note that this differs from |getpos()|, where they are + relative to the buffer. Returns 0 when the position could be set, -1 otherwise. An error message is given if {expr} is invalid.