annotate runtime/plugin/tarPlugin.vim @ 34190:4f8b57f8b07a v9.1.0046

patch 9.1.0046: :drop does not re-use empty buffer Commit: https://github.com/vim/vim/commit/f96dc8d07f752ddd96d1447d85278a85255a1462 Author: Rocco Mao <dapeng.mao@qq.com> Date: Tue Jan 23 21:27:19 2024 +0100 patch 9.1.0046: :drop does not re-use empty buffer Problem: :drop does not re-use empty buffer (Rocco Mao) Solution: Make :drop re-use an empty buffer (Rocco Mao) fixes: #13851 closes: #13881 Signed-off-by: Rocco Mao <dapeng.mao@qq.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Tue, 23 Jan 2024 21:30:05 +0100
parents e003aedbf9e1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
528
66475621f0bf updated for version 7.0147
vimboss
parents:
diff changeset
1 " tarPlugin.vim -- a Vim plugin for browsing tarfiles
1126
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
2 " Original was copyright (c) 2002, Michael C. Toren <mct@toren.net>
4339
22fa3049e934 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
3 " Modified by Charles E. Campbell
528
66475621f0bf updated for version 7.0147
vimboss
parents:
diff changeset
4 " Distributed under the GNU General Public License.
66475621f0bf updated for version 7.0147
vimboss
parents:
diff changeset
5 "
66475621f0bf updated for version 7.0147
vimboss
parents:
diff changeset
6 " Updates are available from <http://michael.toren.net/code/>. If you
66475621f0bf updated for version 7.0147
vimboss
parents:
diff changeset
7 " find this script useful, or have suggestions for improvements, please
66475621f0bf updated for version 7.0147
vimboss
parents:
diff changeset
8 " let me know.
66475621f0bf updated for version 7.0147
vimboss
parents:
diff changeset
9 " Also look there for further comments and documentation.
66475621f0bf updated for version 7.0147
vimboss
parents:
diff changeset
10 "
66475621f0bf updated for version 7.0147
vimboss
parents:
diff changeset
11 " This part only sets the autocommands. The functions are in autoload/tar.vim.
1126
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
12 " ---------------------------------------------------------------------
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
13 " Load Once: {{{1
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
14 if &cp || exists("g:loaded_tarPlugin")
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
15 finish
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
16 endif
19099
1a951a4beee3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
17 let g:loaded_tarPlugin = "v32"
1126
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
18 let s:keepcpo = &cpo
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
19 set cpo&vim
528
66475621f0bf updated for version 7.0147
vimboss
parents:
diff changeset
20
1126
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
21 " ---------------------------------------------------------------------
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
22 " Public Interface: {{{1
557
862863033fdd updated for version 7.0158
vimboss
parents: 528
diff changeset
23 augroup tar
862863033fdd updated for version 7.0158
vimboss
parents: 528
diff changeset
24 au!
1624
18ee39301b82 updated for version 7.2a
vimboss
parents: 1126
diff changeset
25 au BufReadCmd tarfile::* call tar#Read(expand("<amatch>"), 1)
18ee39301b82 updated for version 7.2a
vimboss
parents: 1126
diff changeset
26 au FileReadCmd tarfile::* call tar#Read(expand("<amatch>"), 0)
18ee39301b82 updated for version 7.2a
vimboss
parents: 1126
diff changeset
27 au BufWriteCmd tarfile::* call tar#Write(expand("<amatch>"))
18ee39301b82 updated for version 7.2a
vimboss
parents: 1126
diff changeset
28 au FileWriteCmd tarfile::* call tar#Write(expand("<amatch>"))
528
66475621f0bf updated for version 7.0147
vimboss
parents:
diff changeset
29
557
862863033fdd updated for version 7.0158
vimboss
parents: 528
diff changeset
30 if has("unix")
1624
18ee39301b82 updated for version 7.2a
vimboss
parents: 1126
diff changeset
31 au BufReadCmd tarfile::*/* call tar#Read(expand("<amatch>"), 1)
18ee39301b82 updated for version 7.2a
vimboss
parents: 1126
diff changeset
32 au FileReadCmd tarfile::*/* call tar#Read(expand("<amatch>"), 0)
18ee39301b82 updated for version 7.2a
vimboss
parents: 1126
diff changeset
33 au BufWriteCmd tarfile::*/* call tar#Write(expand("<amatch>"))
18ee39301b82 updated for version 7.2a
vimboss
parents: 1126
diff changeset
34 au FileWriteCmd tarfile::*/* call tar#Write(expand("<amatch>"))
557
862863033fdd updated for version 7.0158
vimboss
parents: 528
diff changeset
35 endif
528
66475621f0bf updated for version 7.0147
vimboss
parents:
diff changeset
36
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1702
diff changeset
37 au BufReadCmd *.tar.gz call tar#Browse(expand("<amatch>"))
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1702
diff changeset
38 au BufReadCmd *.tar call tar#Browse(expand("<amatch>"))
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1702
diff changeset
39 au BufReadCmd *.lrp call tar#Browse(expand("<amatch>"))
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1702
diff changeset
40 au BufReadCmd *.tar.bz2 call tar#Browse(expand("<amatch>"))
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1702
diff changeset
41 au BufReadCmd *.tar.Z call tar#Browse(expand("<amatch>"))
19099
1a951a4beee3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
42 au BufReadCmd *.tbz call tar#Browse(expand("<amatch>"))
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1702
diff changeset
43 au BufReadCmd *.tgz call tar#Browse(expand("<amatch>"))
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1702
diff changeset
44 au BufReadCmd *.tar.lzma call tar#Browse(expand("<amatch>"))
2426
e52d87a2bb3e More runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
45 au BufReadCmd *.tar.xz call tar#Browse(expand("<amatch>"))
e52d87a2bb3e More runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
46 au BufReadCmd *.txz call tar#Browse(expand("<amatch>"))
23047
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19099
diff changeset
47 au BufReadCmd *.tar.zst call tar#Browse(expand("<amatch>"))
34102
e003aedbf9e1 runtime(tar): fix a few problems with the tar plugin
Christian Brabandt <cb@256bit.org>
parents: 23047
diff changeset
48 au BufReadCmd *.tzst call tar#Browse(expand("<amatch>"))
557
862863033fdd updated for version 7.0158
vimboss
parents: 528
diff changeset
49 augroup END
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1702
diff changeset
50 com! -nargs=? -complete=file Vimuntar call tar#Vimuntar(<q-args>)
528
66475621f0bf updated for version 7.0147
vimboss
parents:
diff changeset
51
1126
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
52 " ---------------------------------------------------------------------
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
53 " Restoration And Modelines: {{{1
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
54 " vim: fdm=marker
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
55 let &cpo= s:keepcpo
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
56 unlet s:keepcpo