Skip to content

Commit 566360f

Browse files
authored
Merge pull request #1431 from vim-jp/hh-update-indent
Update indent.{txt,jax}
2 parents 1e932fc + 2f5676c commit 566360f

File tree

2 files changed

+39
-36
lines changed

2 files changed

+39
-36
lines changed

doc/indent.jax

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*indent.txt* For Vim バージョン 9.1. Last change: 2023 Dec 05
1+
*indent.txt* For Vim バージョン 9.1. Last change: 2023 Dec 27
22

33

44
VIMリファレンスマニュアル by Bram Moolenaar
@@ -701,32 +701,34 @@ Clojure のいくつかのフォームは、'lispwords' に依らず、すべて
701701
<
702702
FORTRAN *ft-fortran-indent*
703703

704-
Block if、select case、where、forall 構造がインデントされる。さらに type、
705-
interface、associate、block、enum 構造も。サブルーチン、関数、モジュール、プロ
706-
グラムブロックのインデントは任意。コメント、ラベル付き文、そして2行にまたがっ
707-
た行は、Fortranが自由形式のソースではインデントされるが、一方Fortranが固定形式
708-
ソースの場合には左余白が言語仕様により決定されているのでインデントされない。そ
709-
れ故に固定形式ソースを使っている時にはラベル付き文と2行にまたがった行について
710-
は手動でインデントを修正する必要がある。ソース形式の判定に使われている方法につ
711-
いてのさらなる議論は|ft-fortran-syntax|を参照のこと。
704+
ブロック if、select case、select type、select Rank、where、forall、type、
705+
interface、associate、block、enum、critical、および change team 構造はインデン
706+
トされる。サブルーチン、関数、モジュール、プログラムブロックのインデントは任
707+
意。コメント、ラベル付き文、そして 2 行にまたがった行は、Fortran が自由形式の
708+
ソースではインデントされるが、一方 Fortran が固定形式ソースの場合には左余白が
709+
言語仕様により決定されているのでインデントされない。それ故に固定形式ソースを
710+
使っている時にはラベル付き文と2行にまたがった行については手動でインデントを修
711+
正する必要がある。ソース形式の判定に使われている方法についてのさらなる議論は
712+
|ft-fortran-syntax| を参照のこと。
712713

713714
Doループ ~
714-
デフォルトでは全てのdoループはインデントされない。Fortranでは、ループはラベル
715-
付けされたほとんど任意の型の実行可能な文で(場合によっては多重に)終わるので、do
716-
ループは非構造的になる。これを正しくインデントするにはコンパイラ級の構文解析が
717-
必要になる。任意の型の実行可能文で終わるdoループを持っていたとしても、古いコー
718-
ドであればTidyのように念入りに作られたプログラムでインデントすることはできる。
719-
構造化do/continueループも、continue文がdoループを終了する以外の目的でも使用さ
720-
れるので、インデントせずに残される。Tidyのようなプログラムは構造化do/continue
721-
ループをdo/enddo形式に変換することができる。do/enddoタイプのdoループならばイン
722-
デントすることができる。do/enddoの形の構造化されたループしか使わないのならば、
723-
.vimrcで以下のようにfortran_do_enddo変数を設定してそのことを宣言するべきである:
715+
デフォルトでは全ての do ループはインデントされない。Fortran では、ループはラベ
716+
ル付けされたほとんど任意の型の実行可能な文で (場合によっては多重に) 終わるの
717+
で、do ループは非構造的になる。これを正しくインデントするにはコンパイラ級の構
718+
文解析が必要になる。任意の型の実行可能文で終わる do ループを持っていたとして
719+
も、古いコードであれば Tidy のように念入りに作られたプログラムでインデントする
720+
ことはできる。構造化 do/continue ループも、continue 文が do ループを終了する以
721+
外の目的でも使用されるので、インデントせずに残される。Tidy のようなプログラム
722+
は構造化 do/continue ループを do/enddo 形式に変換することができる。do/enddo タ
723+
イプの do ループならばインデントすることができる。do/enddo の形の構造化された
724+
ループしか使わないのならば、.vimrc で以下のように fortran_do_enddoi 変数を設定
725+
してそのことを宣言するべきである:
724726
>
725727
let fortran_do_enddo=1
726728
727-
このようにすればdoループはインデントされる。例えば拡張子が.f90 であるファイル
728-
の中にある全てのループがdo/enddoタイプだけならば、このようなautocommandを使っ
729-
てのバッファフラグを設定することができる: >
729+
このようにすれば do ループはインデントされる。例えば拡張子が .f90 であるファイ
730+
ルの中にある全てのループが do/enddo タイプだけならば、このような自動コマンドを
731+
使ってのバッファフラグを設定することができる: >
730732
731733
au! BufRead,BufNewFile *.f90 let b:fortran_do_enddo=1
732734
@@ -1021,8 +1023,8 @@ r_indent_comment_column の値を設定すること。次のようにする:
10211023
let r_indent_comment_column = 30
10221024
<
10231025
行末が "<-" で終わる行に続くコードはインデントされる。Emacs/ESS ではそれがトッ
1024-
プレベル関数ならインデントはされない。Emacs/ESS と同じようにインデントしたい場
1025-
合は次の設定を |vimrc| に書くこと:
1026+
プレベル関数ならインデントはされない。この点で Emacs/ESS のような動作を希望す
1027+
る場合は、次の設定を |vimrc| に書くこと:
10261028
>
10271029
let r_indent_ess_compatible = 1
10281030
<

en/indent.txt

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*indent.txt* For Vim version 9.1. Last change: 2023 Dec 05
1+
*indent.txt* For Vim version 9.1. Last change: 2023 Dec 27
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -712,15 +712,16 @@ clojure-mode.el:
712712

713713
FORTRAN *ft-fortran-indent*
714714

715-
Block if, select case, where, and forall constructs are indented. So are
716-
type, interface, associate, block, and enum constructs. The indenting of
717-
subroutines, functions, modules, and program blocks is optional. Comments,
718-
labeled statements, and continuation lines are indented if the Fortran is in
719-
free source form, whereas they are not indented if the Fortran is in fixed
720-
source form because of the left margin requirements. Hence manual indent
721-
corrections will be necessary for labelled statements and continuation lines
722-
when fixed source form is being used. For further discussion of the method
723-
used for the detection of source format see |ft-fortran-syntax|.
715+
Block if, select case, select type, select rank, where, forall, type,
716+
interface, associate, block, enum, critical, and change team constructs are
717+
indented. The indenting of subroutines, functions, modules, and program blocks
718+
is optional. Comments, labeled statements, and continuation lines are indented
719+
if the Fortran is in free source form, whereas they are not indented if the
720+
Fortran is in fixed source form because of the left margin requirements. Hence
721+
manual indent corrections will be necessary for labeled statements and
722+
continuation lines when fixed source form is being used. For further
723+
discussion of the method used for the detection of source format see
724+
|ft-fortran-syntax|.
724725

725726
Do loops ~
726727
All do loops are left unindented by default. Do loops can be unstructured in
@@ -1040,8 +1041,8 @@ r_indent_comment_column, as in the example below:
10401041
let r_indent_comment_column = 30
10411042
<
10421043
Any code after a line that ends with "<-" is indented. Emacs/ESS does not
1043-
indent the code if it is a top level function. If you prefer that the
1044-
Vim-R-plugin behaves like Emacs/ESS in this regard, put in your |vimrc|:
1044+
indent the code if it is a top-level function. If you prefer a behavior like
1045+
Emacs/ESS one in this regard, put in your |vimrc|:
10451046
>
10461047
let r_indent_ess_compatible = 1
10471048
<

0 commit comments

Comments
 (0)