annotate runtime/doc/pi_gzip.txt @ 34536:ad6cd802579d v9.1.0170

patch 9.1.0170: Re-allow curwin == prevwin, but document it instead Commit: https://github.com/vim/vim/commit/d64801e913314d2e19dbb38f60e6d285238debff Author: Sean Dewar <6256228+seandewar@users.noreply.github.com> Date: Tue Mar 12 20:46:12 2024 +0100 patch 9.1.0170: Re-allow curwin == prevwin, but document it instead Problem: more places exist where curwin == prevwin, and it may even be expected in some cases. Solution: revert v9.1.0001, but document that it's possible instead. (Sean Dewar) I've had a change of heart for the following reasons: - A quick 'n dirty [GitHub code search](https://github.com/search?q=%2F%28winnr%5C%28%5C%29%5Cs*%3D%3D%5Cs*winnr%5C%28%5B%27%22%5D%23%5B%27%22%5D%5C%29%7Cwinnr%5C%28%5B%27%22%5D%23%5B%27%22%5D%5C%29%5Cs*%3D%3D%5Cs*winnr%5C%28%5C%29%29%2F&type=code) reveals some cases where it's expected in the wild. Particularly, it made me aware `winnr() == winnr('#')` is possible when curwin is changed temporarily during the evaluation of a &statusline expression item (`%{...}`), and is used to show something different on the statusline belonging to the previous window; that behaviour wasn't changed in v9.1.0001, but it means curwin == prevwin makes sense in some cases. - The definition and call sites of back_to_prevwin imply some expectation that prevwin == wp (== curwin) is possible, as it's used to skip entering the prevwin in that case. - Prior to v9.1.0001, `:wincmd p` would not beep in the case that was patched in v9.1.0001, but now does. That resulted in #14047 being opened, as it affected the CtrlP plugin. I find it odd that `:wincmd p` had cases where it wouldn't beep despite doing nothing, but it may be preferable to keep things that way (or instead also beep if curwin == prevwin, if that's preferred). - After more digging, I found cases in win_free_mem, enter_tabpage, aucmd_restbuf and qf_open_new_cwindow where curwin == prevwin is possible (many of them from autocommands). Others probably exist too, especially in places where curwin is changed temporarily. fixes: #14047 closes: #14186 Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Tue, 12 Mar 2024 21:00:11 +0100
parents 4635e43f2c6f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
34057
4635e43f2c6f patch 9.1.0000: Vim 9.1 release
Christian Brabandt <cb@256bit.org>
parents: 33766
diff changeset
1 *pi_gzip.txt* For Vim version 9.1. Last change: 2023 Nov 14
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 VIM REFERENCE MANUAL by Bram Moolenaar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 Editing compressed files with Vim *gzip* *bzip2* *compress*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 1. Autocommands |gzip-autocmd|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 The functionality mentioned here is a |standard-plugin|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 This plugin is only available if 'compatible' is not set.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 You can avoid loading this plugin by setting the "loaded_gzip" variable: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 :let loaded_gzip = 1
33721
d7ac49e53d62 runtime(doc): document vim-script library function
Christian Brabandt <cb@256bit.org>
parents: 29314
diff changeset
15 <
d7ac49e53d62 runtime(doc): document vim-script library function
Christian Brabandt <cb@256bit.org>
parents: 29314
diff changeset
16 *g:gzip_exec*
d7ac49e53d62 runtime(doc): document vim-script library function
Christian Brabandt <cb@256bit.org>
parents: 29314
diff changeset
17
d7ac49e53d62 runtime(doc): document vim-script library function
Christian Brabandt <cb@256bit.org>
parents: 29314
diff changeset
18 For security reasons, one may prevent that Vim runs executables automatically
d7ac49e53d62 runtime(doc): document vim-script library function
Christian Brabandt <cb@256bit.org>
parents: 29314
diff changeset
19 when opening a buffer. This option (default: "1") can be used to prevent
d7ac49e53d62 runtime(doc): document vim-script library function
Christian Brabandt <cb@256bit.org>
parents: 29314
diff changeset
20 executing the executables command when set to "0": >
d7ac49e53d62 runtime(doc): document vim-script library function
Christian Brabandt <cb@256bit.org>
parents: 29314
diff changeset
21 :let g:gzip_exec = 0
d7ac49e53d62 runtime(doc): document vim-script library function
Christian Brabandt <cb@256bit.org>
parents: 29314
diff changeset
22 <
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 ==============================================================================
33766
fc557aa379ef runtime(doc): fix typo in pi_gzip.txt
Christian Brabandt <cb@256bit.org>
parents: 33721
diff changeset
25 1. Autocommands *gzip-autocmd*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 The plugin installs autocommands to intercept reading and writing of files
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 with these extensions:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 extension compression ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 *.Z compress (Lempel-Ziv)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 *.gz gzip
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 *.bz2 bzip2
3713
9910cbff5f16 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2577
diff changeset
34 *.lzma lzma
9910cbff5f16 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2577
diff changeset
35 *.xz xz
10319
169a62d5bcb9 commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
36 *.lz lzip
10385
368468ef35cf commit https://github.com/vim/vim/commit/c0514bf4777a1d55f5785b3887c5686fd0bbe870
Christian Brabandt <cb@256bit.org>
parents: 10319
diff changeset
37 *.zst zstd
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 That's actually the only thing you need to know. There are no options.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 After decompressing a file, the filetype will be detected again. This will
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 make a file like "foo.c.gz" get the "c" filetype.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 If you have 'patchmode' set, it will be appended after the extension for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 compression. Thus editing the patchmode file will not give you the automatic
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 decompression. You have to rename the file if you want this.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 ==============================================================================
14421
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13963
diff changeset
49 vim:tw=78:ts=8:noet:ft=help:norl: