Skip to content

Commit 6a507eb

Browse files
authored
Merge pull request #2042 from h-east/update-usr_05
Update usr_05.{txt,jax}
2 parents 1c39fa5 + f3e946b commit 6a507eb

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

doc/usr_05.jax

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*usr_05.txt* For Vim バージョン 9.1. Last change: 2025 Mar 22
1+
*usr_05.txt* For Vim バージョン 9.1. Last change: 2025 Apr 10
22

33
VIM USER MANUAL - by Bram Moolenaar
44

@@ -314,24 +314,28 @@ CTRL-U でアンドゥすることができます。":iunmap <C-U>" で元に戻
314314
|:filetype-indent-on|'indentexpr' 参照。
315315

316316

317-
*restore-cursor* *last-position-jump* >
317+
*restore-cursor* *last-position-jump* >vim
318318
augroup RestoreCursor
319319
autocmd!
320320
autocmd BufReadPost *
321321
\ let line = line("'\"")
322322
\ | if line >= 1 && line <= line("$") && &filetype !~# 'commit'
323323
\ && index(['xxd', 'gitrebase'], &filetype) == -1
324+
\ && !&diff
324325
\ | execute "normal! g`\""
325326
\ | endif
326327
augroup END
327328

328329
自動コマンドをもう一つ。ファイルを読み込んだ直後に実行される自動コマンドを定義
329330
しています。後ろのごちゃごちゃした部分は「'" マークが定義されているかどうかを
330-
チェックし、定義があればそこにジャンプする」という意味です。コミットやリベース
331-
メッセージの場合は、前回とは違うメッセージになる可能性が高く、また、xxd(1) を
332-
使ってバイナリファイルをフィルタリングして編集を行う場合は、入力ファイルを行っ
333-
たり来たり変換して、いわば二面性を持っているため、このようなことは行いません。
334-
|using-xxd| も参照してください。
331+
チェックし、定義があればそこにジャンプする」という意味です。以下の場合にはこの
332+
処理は実行されません:
333+
- コミットやリベースメッセージの場合は、前回とは違うメッセージになる可能性が
334+
高い
335+
- xxd(1) を使ってバイナリファイルをフィルタリングして編集を行う場合は、入力
336+
ファイルを行ったり来たり変換して、いわば二面性を持っているため (|using-xxd|
337+
も参照)
338+
- Vim が diff モードになっている
335339

336340
コマンドを複数行に分けて書くために、行頭に "\" を書いています。行がやたらと長
337341
くなるのを防ぐためです。|line-continuation| 参照。"\" は Vim script 内でのみ使

en/usr_05.txt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*usr_05.txt* For Vim version 9.1. Last change: 2025 Mar 22
1+
*usr_05.txt* For Vim version 9.1. Last change: 2025 Apr 10
22

33
VIM USER MANUAL - by Bram Moolenaar
44

@@ -307,23 +307,27 @@ This switches on three very clever mechanisms:
307307
filetypes. See |:filetype-indent-on| and 'indentexpr'.
308308

309309

310-
*restore-cursor* *last-position-jump* >
310+
*restore-cursor* *last-position-jump* >vim
311311
augroup RestoreCursor
312312
autocmd!
313313
autocmd BufReadPost *
314314
\ let line = line("'\"")
315315
\ | if line >= 1 && line <= line("$") && &filetype !~# 'commit'
316316
\ && index(['xxd', 'gitrebase'], &filetype) == -1
317+
\ && !&diff
317318
\ | execute "normal! g`\""
318319
\ | endif
319320
augroup END
320321

321322
Another autocommand. This time it is used after reading any file. The
322323
complicated stuff after it checks if the '" mark is defined, and jumps to it
323-
if so. It doesn't do that for a commit or rebase message, which are likely
324-
a different one than last time, and when using xxd(1) to filter and edit
325-
binary files, which transforms input files back and forth, causing them to
326-
have dual nature, so to speak. See also |using-xxd|.
324+
if so. It doesn't do that when:
325+
- editing a commit or rebase message, which are likely a different one than
326+
last time,
327+
- using xxd(1) to filter and edit binary files, which transforms input files
328+
back and forth, causing them to have dual nature, so to speak (see also
329+
|using-xxd|) and
330+
- Vim is in diff mode
327331

328332
The backslash at the start of a line is used to continue the command from the
329333
previous line. That avoids a line getting very long. See |line-continuation|.

0 commit comments

Comments
 (0)