Skip to content

Commit 43cf618

Browse files
committed
Update develop.{txt,jax}
1 parent 083f622 commit 43cf618

File tree

2 files changed

+59
-136
lines changed

2 files changed

+59
-136
lines changed

doc/develop.jax

Lines changed: 30 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*develop.txt* For Vim バージョン 9.1. Last change: 2025 Apr 18
1+
*develop.txt* For Vim バージョン 9.1. Last change: 2025 May 05
22

33

44
VIMリファレンスマニュアル by Bram Moolenaar
@@ -217,7 +217,7 @@ sound.c と sign.c は、配布された .clang-format ファイルに従って
217217
Marriott)
218218

219219

220-
☆コメント *style-comments*
220+
☆コメント *style-comments*
221221

222222
関数本体内に複数行のコメントを入れないようにすること。関数が非常に複雑で、一部
223223
を個別にコメントする必要がある場合は、関数の構造を再検討する必要がある。
@@ -232,15 +232,15 @@ sound.c と sign.c は、配布された .clang-format ファイルに従って
232232
<
233233

234234

235-
☆インデント *style-indentation*
235+
☆インデント *style-indentation*
236236

237237
コードのインデントには 4 つのスペースを使用する。Vim を使用してソースを編集し
238238
ている場合は、|modeline| があるため何もする必要はない。
239239

240240
他のエディタの場合は、リポジトリのルートに `.editorconfig` が提供される。
241241

242242

243-
☆宣言 *style-declarations*
243+
☆宣言 *style-declarations*
244244

245245
可能であれば、ガード内で `for` ループ変数を宣言する:
246246
OK: >
@@ -261,113 +261,77 @@ OK: >
261261
<
262262

263263

264-
☆括弧 *style-braces*
264+
☆括弧 *style-braces*
265265

266266
すべての波括弧は改行しなければならない:
267267
OK: >
268268
if (cond)
269269
{
270-
cmd;
271-
cmd;
270+
cmd;
271+
cmd;
272272
}
273273
else
274274
{
275-
cmd;
276-
cmd;
275+
cmd;
276+
cmd;
277277
}
278278
<
279279
間違い: >
280280
if (cond) {
281-
cmd;
282-
cmd;
281+
cmd;
282+
cmd;
283283
} else {
284-
cmd;
285-
cmd;
284+
cmd;
285+
cmd;
286286
}
287287
<
288288
OK: >
289289
while (cond)
290290
{
291291
cmd;
292+
cmd;
292293
}
293294
<
294295
間違い: >
295296
while (cond) {
296297
cmd;
298+
cmd;
297299
}
298300
<
299-
ブロックがコメントを含めて 1 行の場合は、波括弧は省略できる。
300301
OK: >
301-
if (cond)
302-
cmd;
303-
else
304-
cmd;
305-
<
306-
間違い: >
307-
if (cond)
308-
/*
309-
* comment
310-
*/
302+
do
303+
{
311304
cmd;
312-
else
313305
cmd;
306+
} while (cond);
314307
<
315-
`if`/`else` の一方のブロックに波括弧がある場合は、もう一方のブロックにも波括弧
316-
が必要である。
317-
OK: >
318-
if (cond)
319-
{
320-
cmd;
321-
}
322-
else
308+
または >
309+
do
323310
{
324311
cmd;
325312
cmd;
326313
}
314+
while (cond);
327315
<
328316
間違い: >
329-
if (cond)
317+
do {
330318
cmd;
331-
else
332-
{
333-
cmd;
334-
cmd;
335-
}
336-
337-
if (cond)
338-
{
339-
cmd;
340-
cmd;
341-
}
342-
else
343-
cmd;
344-
<
345-
OK: >
346-
while (cond)
347319
cmd;
348-
<
349-
間違い:
350-
>
351-
while (cond)
352-
if (cond)
353-
cmd;
320+
} while (cond);
354321
<
355322

356323

357324
☆型 *style-types*
358325

359-
記述的な型を使用すること。それらのリストは src/structs.h ファイル内、またはお
360-
そらく作業中のファイルの typedef 内にある。
361-
326+
説明的な型を使用すること。これらは src/vim.h、src/structs.h などで定義されてい
327+
る。
362328
Note すべてのカスタム型には「_T」という接尾辞が付けられることに注意
363329

364-
OK: >
365-
int is_valid_line_number(linenr_T lnum);
330+
例: >
331+
linenr_T
332+
buf_T
333+
pos_T
366334
<
367-
間違い: >
368-
int is_valid_line_number(unsigned long lnum);
369-
<
370-
371335

372336
☆空白と句読法 *style-spaces*
373337

@@ -388,8 +352,8 @@ OK: func(arg1, arg2); for (i = 0; i < 2; ++i)
388352

389353
'=', '+', '/' 等の前後に空白を入れる。
390354

391-
間違い: var=a*5;
392355
OK: var = a * 5;
356+
間違い: var=a*5;
393357

394358
似たような動作をグループ化するには、空行を使う。
395359

@@ -414,7 +378,6 @@ OK: >
414378
while (buf != NULL && !got_int)
415379
<
416380

417-
418381
☆関数 *style-functions*
419382

420383
関数宣言は、戻り値の型を別のインデントされた行に記述して使用する:

en/develop.txt

Lines changed: 29 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*develop.txt* For Vim version 9.1. Last change: 2025 Apr 18
1+
*develop.txt* For Vim version 9.1. Last change: 2025 May 05
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -215,7 +215,7 @@ them:
215215
- flexible array members: Not supported by HP-UX C compiler (John Marriott)
216216

217217

218-
COMMENTS *style-comments*
218+
COMMENTS *style-comments*
219219

220220
Try to avoid putting multiline comments inside a function body: if the
221221
function is so complex that you need to separately comment parts of it, you
@@ -230,16 +230,15 @@ For everything else use: >
230230
// comment
231231
<
232232

233-
234-
INDENTATION *style-indentation*
233+
INDENTATION *style-indentation*
235234

236235
We use 4 space to indent the code. If you are using Vim to edit the source,
237236
you don't need to do anything due to the |modeline|.
238237

239238
For other editors an `.editorconfig` is provided at the root of the repo.
240239

241240

242-
DECLARATIONS *style-declarations*
241+
DECLARATIONS *style-declarations*
243242

244243
Declare, when possible, `for` loop variables in the guard:
245244
OK: >
@@ -259,114 +258,76 @@ Wrong: >
259258
int *ptr;
260259
<
261260

262-
263-
BRACES *style-braces*
261+
BRACES *style-braces*
264262

265263
All curly braces must be returned onto a new line:
266264
OK: >
267265
if (cond)
268266
{
269-
cmd;
270-
cmd;
267+
cmd;
268+
cmd;
271269
}
272270
else
273271
{
274-
cmd;
275-
cmd;
272+
cmd;
273+
cmd;
276274
}
277275
<
278276
Wrong: >
279277
if (cond) {
280-
cmd;
281-
cmd;
278+
cmd;
279+
cmd;
282280
} else {
283-
cmd;
284-
cmd;
281+
cmd;
282+
cmd;
285283
}
286284
<
287285
OK: >
288286
while (cond)
289287
{
290288
cmd;
289+
cmd;
291290
}
292291
<
293292
Wrong: >
294293
while (cond) {
295294
cmd;
295+
cmd;
296296
}
297297
<
298-
When a block has one line, including comments, the braces can be left out.
299298
OK: >
300-
if (cond)
301-
cmd;
302-
else
303-
cmd;
304-
<
305-
Wrong: >
306-
if (cond)
307-
/*
308-
* comment
309-
*/
299+
do
300+
{
310301
cmd;
311-
else
312302
cmd;
303+
} while (cond);
313304
<
314-
When an `if`/`else` has braces on one block, the other should have it too.
315-
OK: >
316-
if (cond)
317-
{
318-
cmd;
319-
}
320-
else
305+
or >
306+
do
321307
{
322308
cmd;
323309
cmd;
324310
}
311+
while (cond);
325312
<
326313
Wrong: >
327-
if (cond)
328-
cmd;
329-
else
330-
{
331-
cmd;
332-
cmd;
333-
}
334-
335-
if (cond)
336-
{
337-
cmd;
338-
cmd;
339-
}
340-
else
314+
do {
341315
cmd;
342-
<
343-
OK: >
344-
while (cond)
345316
cmd;
317+
} while (cond);
346318
<
347-
Wrong:
348-
>
349-
while (cond)
350-
if (cond)
351-
cmd;
352-
<
353-
354319

355320
TYPES *style-types*
356321

357-
Use descriptive types. You can find a list of them in the src/structs.h file
358-
and probably in a typedef in the file you are working on.
359-
322+
Use descriptive types. These are defined in src/vim.h, src/structs.h etc.
360323
Note that all custom types are postfixed with "_T"
361324

362-
OK: >
363-
int is_valid_line_number(linenr_T lnum);
364-
<
365-
Wrong: >
366-
int is_valid_line_number(unsigned long lnum);
325+
Example: >
326+
linenr_T
327+
buf_T
328+
pos_T
367329
<
368330

369-
370331
SPACES AND PUNCTUATION *style-spaces*
371332

372333
No space between a function name and the bracket:
@@ -386,8 +347,8 @@ Wrong: func(arg1,arg2); for (i = 0;i < 2;++i)
386347

387348
Use a space before and after '=', '+', '/', etc.
388349

389-
Wrong: var=a*5;
390350
OK: var = a * 5;
351+
Wrong: var=a*5;
391352

392353
Use empty lines to group similar actions together.
393354

@@ -412,7 +373,6 @@ Wrong: >
412373
while (buf != NULL && !got_int)
413374
<
414375

415-
416376
FUNCTIONS *style-functions*
417377

418378
Use function declarations with the return type on a separate indented line.

0 commit comments

Comments
 (0)