Sean Dewar
d64801e913
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 >
2024-03-12 20:50:27 +01:00
..
2024-01-02 16:51:11 +01:00
2024-01-25 23:07:00 +01:00
2024-03-12 20:50:27 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-02-12 20:24:56 +01:00
2024-01-02 16:51:11 +01:00
2022-07-30 12:03:16 +01:00
2020-01-21 22:13:42 +01:00
2024-01-14 21:02:54 +01:00
2024-02-08 11:23:22 +01:00
2023-08-31 18:03:11 +02:00
2023-08-31 18:03:11 +02:00
2020-05-31 14:25:22 +02:00
2020-05-31 14:25:22 +02:00
2024-01-02 16:51:11 +01:00
2024-02-25 08:42:52 +01:00
2024-01-02 16:51:11 +01:00
2024-02-25 08:42:52 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2021-06-27 15:18:56 +02:00
2022-02-26 12:25:45 +00:00
2024-01-01 20:50:51 +01:00
2024-02-25 08:42:52 +01:00
2024-01-23 23:19:02 +01:00
2024-01-30 23:37:41 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-02-25 08:42:52 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-02-29 18:13:04 +01:00
2024-01-23 20:34:28 +01:00
2024-01-05 18:19:52 +01:00
2024-01-25 22:44:00 +01:00
2023-11-11 19:26:00 +01:00
2024-01-22 20:42:44 +01:00
2024-01-22 20:42:44 +01:00
2020-05-26 21:20:45 +02:00
2024-01-14 19:24:05 +01:00
2024-02-25 08:42:52 +01:00
2024-01-02 16:51:11 +01:00
2024-03-05 20:39:07 +01:00
2024-01-02 16:51:11 +01:00
2024-01-04 22:11:33 +01:00
2024-01-02 16:51:11 +01:00
2024-03-11 15:13:16 +00:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-02-25 08:42:52 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2020-01-14 19:29:13 +01:00
2024-02-25 08:42:52 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-02-25 08:42:52 +01:00
2024-03-03 16:16:47 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-03-10 19:34:32 +01:00
2024-01-02 16:51:11 +01:00
2024-03-06 21:39:35 +01:00
2024-03-03 16:16:47 +01:00
2024-02-28 21:46:15 +01:00
2024-02-25 08:42:52 +01:00
2023-11-04 09:57:09 +01:00
2024-02-18 18:57:07 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-03-03 16:34:51 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-02-25 15:23:02 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-01-02 16:51:11 +01:00
2024-03-03 16:34:51 +01:00
2024-01-02 16:51:11 +01:00
2023-11-04 09:57:09 +01:00
2024-02-25 08:42:52 +01:00
2024-03-03 16:34:51 +01:00
2020-07-26 17:00:44 +02:00
2020-07-26 17:00:44 +02:00
2020-07-26 17:00:44 +02:00
2020-07-26 17:00:44 +02:00
2023-08-27 19:35:34 +02:00
2023-08-27 19:35:34 +02:00
2022-02-20 19:48:20 +00:00
2020-07-26 17:00:44 +02:00
2020-07-26 17:00:44 +02:00
2023-12-29 16:30:40 +01:00
2023-12-29 16:30:40 +01:00
2022-01-23 12:07:04 +00:00
2022-01-23 12:07:04 +00:00
2023-08-31 18:03:11 +02:00
2023-08-31 18:03:11 +02:00
2022-01-16 14:46:06 +00:00
2020-05-31 14:25:22 +02:00
2020-05-31 14:25:22 +02:00
2021-06-13 19:02:49 +02:00
2021-06-13 19:02:49 +02:00
2023-08-31 18:03:11 +02:00
2023-08-31 18:03:11 +02:00
2023-12-19 20:21:40 +01:00
2020-05-31 14:25:22 +02:00
2020-05-31 14:25:22 +02:00
2023-04-22 22:40:14 +01:00
2023-04-22 22:40:14 +01:00
2024-01-02 16:51:11 +01:00
2024-02-20 21:52:31 +01:00
2024-01-02 16:51:11 +01:00
2023-10-06 19:51:13 +02:00
2023-10-06 19:51:13 +02:00
2023-10-08 19:05:02 +02:00
2023-10-08 19:05:02 +02:00
2023-12-19 20:21:40 +01:00
2023-10-06 19:51:13 +02:00
2023-10-06 19:51:13 +02:00
2023-10-06 19:51:13 +02:00
2023-10-06 19:51:13 +02:00
2023-10-06 19:51:13 +02:00
2023-10-06 19:51:13 +02:00