Mercurial > vim
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 |
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 | 2 |
3 | |
4 VIM REFERENCE MANUAL by Bram Moolenaar | |
5 | |
6 | |
7 Editing compressed files with Vim *gzip* *bzip2* *compress* | |
8 | |
9 1. Autocommands |gzip-autocmd| | |
10 | |
11 The functionality mentioned here is a |standard-plugin|. | |
12 This plugin is only available if 'compatible' is not set. | |
13 You can avoid loading this plugin by setting the "loaded_gzip" variable: > | |
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 | 23 |
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 | 26 |
27 The plugin installs autocommands to intercept reading and writing of files | |
28 with these extensions: | |
29 | |
30 extension compression ~ | |
31 *.Z compress (Lempel-Ziv) | |
32 *.gz gzip | |
33 *.bz2 bzip2 | |
3713 | 34 *.lzma lzma |
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 | 38 |
39 That's actually the only thing you need to know. There are no options. | |
40 | |
41 After decompressing a file, the filetype will be detected again. This will | |
42 make a file like "foo.c.gz" get the "c" filetype. | |
43 | |
44 If you have 'patchmode' set, it will be appended after the extension for | |
45 compression. Thus editing the patchmode file will not give you the automatic | |
46 decompression. You have to rename the file if you want this. | |
47 | |
48 ============================================================================== | |
14421 | 49 vim:tw=78:ts=8:noet:ft=help:norl: |