From 0018e16ee6352b4393462ee4060ec2d7ad573ee3 Mon Sep 17 00:00:00 2001 From: h-east Date: Wed, 30 Apr 2025 16:25:19 +0900 Subject: [PATCH 1/3] Update syntax.{txt,jax} --- doc/syntax.jax | 22 +++++++++++++++++++--- en/syntax.txt | 22 ++++++++++++++++++---- 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/doc/syntax.jax b/doc/syntax.jax index 537d49193..c8fdec2a5 100644 --- a/doc/syntax.jax +++ b/doc/syntax.jax @@ -1,4 +1,4 @@ -*syntax.txt* For Vim バージョン 9.1. Last change: 2025 Apr 15 +*syntax.txt* For Vim バージョン 9.1. Last change: 2025 Apr 28 VIMリファレンスマニュアル by Bram Moolenaar @@ -1037,8 +1037,13 @@ Cには幾つかの補助的なハイライト方法がある。それらを有 *c_ansi_typedefs* ... 但し標準ANSI型はハイライトする *c_ansi_constants* ... 但し標準ANSI定数はハイライトする *c_no_utf* 文字列中の\uと\Uをハイライトしない -*c_syntax_for_h* ファイル *.h に C++ ではなく C の構文を適用し、 - objcpp ではなく objc の構文を適用する。 +*c_syntax_for_h* *.h ファイルには C++/ObjC/ObjC++ ではなく C の構文を使 + 用する + (NOTE: この変数は非推奨であり現在は不要である。*.h ファ + イルは、C++ やObjective-C の構文が含まれていない限り、 + デフォルトで C として扱われる。自動検出が失敗した場合 + は、`g:filetype_h` を使ってデフォルトのファイルタイプ + を調整できる。) *c_no_if0* "#if 0" のブロックをコメントとしてハイライトしない *c_no_cformat* 文字列中の "%" によるフォーマットをハイライトしない *c_no_c99* C99の標準アイテムをハイライトしない @@ -1097,6 +1102,10 @@ C/C++ インタープリター。Ch は C に似た構文ハイライトを持 変数を設定すれば、*.h ファイルに対して C, C++ でなく Ch の構文を使うようにする ことができる: > + :let g:filetype_h = 'ch' + +NOTE: Vim の以前のバージョンでは、以下の (現在は非推奨の) 変数が使用されていた +が、現在は推奨される方法ではない: > :let ch_syntax_for_h = 1 @@ -2107,6 +2116,13 @@ Note これら 3 つの変数は HTML 構文ファイルで維持されること 合は 1 行目の内容を表示するように以下で選択できる > :let g:java_foldtext_show_first_or_second_line = 1 +Javadoc コメント内の HTML タグは、|html-folding| に記載されている指示に従い、 +以下に明示的に同意することでさらに折り畳むことができる > + :let g:java_consent_to_html_syntax_folding = 1 +Javadoc コメント内のすべての開始タグとオプションの終了タグがバランスが取れてい +ない限り、この種の折り畳みをデフォルトにしないこと。そうでない場合は、構文の愛 +ライトを壊す暴走した折り畳みが作成されることを我慢すること。 + 末尾の空白文字またはタブ文字の前の連続したスペース文字は、以下でエラーとして マークされる > :let g:java_space_errors = 1 diff --git a/en/syntax.txt b/en/syntax.txt index ae89bd9f1..ed7283012 100644 --- a/en/syntax.txt +++ b/en/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 9.1. Last change: 2025 Apr 15 +*syntax.txt* For Vim version 9.1. Last change: 2025 Apr 28 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1056,8 +1056,12 @@ Variable Highlight ~ *c_ansi_typedefs* ... but do standard ANSI types *c_ansi_constants* ... but do standard ANSI constants *c_no_utf* don't highlight \u and \U in strings -*c_syntax_for_h* for *.h files use C syntax instead of C++ and use objc - syntax instead of objcpp +*c_syntax_for_h* use C syntax for *.h files instead of C++/ObjC/ObjC++ + (NOTE: This variable is deprecated and no longer + necessary, as *.h files now default to C, unless the + file contains C++ or Objective-C syntax. If the + automated detection fails, the default filetype can + be adjusted using `g:filetype_h`.) *c_no_if0* don't highlight "#if 0" blocks as comments *c_no_cformat* don't highlight %-formats in strings *c_no_c99* don't highlight C99 standard items @@ -1116,8 +1120,11 @@ the C syntax file. See |c.vim| for all the settings that are available for C. By setting a variable you can tell Vim to use Ch syntax for *.h files, instead of C or C++: > - :let ch_syntax_for_h = 1 + :let g:filetype_h = 'ch' +NOTE: In previous versions of Vim, the following (now-deprecated) variable was +used, but is no longer the preferred approach: > + :let ch_syntax_for_h = 1 CHILL *chill.vim* *ft-chill-syntax* @@ -2168,6 +2175,13 @@ line for any comments written in this way, and showing the contents of a first line otherwise, with > :let g:java_foldtext_show_first_or_second_line = 1 +HTML tags in Javadoc comments can additionally be folded by following the +instructions listed under |html-folding| and giving explicit consent with > + :let g:java_consent_to_html_syntax_folding = 1 +Do not default to this kind of folding unless ALL start tags and optional end +tags are balanced in Javadoc comments; otherwise, put up with creating runaway +folds that break syntax highlighting. + Trailing whitespace characters or a run of space characters before a tab character can be marked as an error with > :let g:java_space_errors = 1 From 2e232149d609e27ba853f115bf9b78fd52271695 Mon Sep 17 00:00:00 2001 From: h_east Date: Wed, 30 Apr 2025 21:31:53 +0900 Subject: [PATCH 2/3] Update doc/syntax.jax Co-authored-by: Tsuyoshi CHO --- doc/syntax.jax | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/syntax.jax b/doc/syntax.jax index c8fdec2a5..570d369f6 100644 --- a/doc/syntax.jax +++ b/doc/syntax.jax @@ -2120,8 +2120,8 @@ Javadoc コメント内の HTML タグは、|html-folding| に記載されてい 以下に明示的に同意することでさらに折り畳むことができる > :let g:java_consent_to_html_syntax_folding = 1 Javadoc コメント内のすべての開始タグとオプションの終了タグがバランスが取れてい -ない限り、この種の折り畳みをデフォルトにしないこと。そうでない場合は、構文の愛 -ライトを壊す暴走した折り畳みが作成されることを我慢すること。 +ない限り、この種の折り畳みをデフォルトにしないこと。そうでない場合は、構文のハ +イライトを壊す暴走した折り畳みが作成されることを我慢すること。 末尾の空白文字またはタブ文字の前の連続したスペース文字は、以下でエラーとして マークされる > From 1737360f2f86c4d6556f3c8e8c268d97131ef9fb Mon Sep 17 00:00:00 2001 From: h-east Date: Wed, 30 Apr 2025 21:34:36 +0900 Subject: [PATCH 3/3] Fix by review --- doc/syntax.jax | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/syntax.jax b/doc/syntax.jax index 570d369f6..cd37b93e0 100644 --- a/doc/syntax.jax +++ b/doc/syntax.jax @@ -1040,10 +1040,10 @@ Cには幾つかの補助的なハイライト方法がある。それらを有 *c_syntax_for_h* *.h ファイルには C++/ObjC/ObjC++ ではなく C の構文を使 用する (NOTE: この変数は非推奨であり現在は不要である。*.h ファ - イルは、C++ やObjective-C の構文が含まれていない限り、 - デフォルトで C として扱われる。自動検出が失敗した場合 - は、`g:filetype_h` を使ってデフォルトのファイルタイプ - を調整できる。) + イルは、C++ や Objective-C の構文が含まれていない限 + り、デフォルトで C として扱われる。自動検出が失敗した + 場合は、`g:filetype_h` を使ってデフォルトのファイルタ + イプを調整できる。) *c_no_if0* "#if 0" のブロックをコメントとしてハイライトしない *c_no_cformat* 文字列中の "%" によるフォーマットをハイライトしない *c_no_c99* C99の標準アイテムをハイライトしない