mirror of
https://github.com/neovim/neovim.git
synced 2025-10-07 10:26:31 +00:00
vim-patch:9.1.0147: Cannot keep a buffer focused in a window
Problem: Cannot keep a buffer focused in a window
(Amit Levy)
Solution: Add the 'winfixbuf' window-local option
(Colin Kennedy)
fixes: vim/vim#6445
closes: vim/vim#13903
2157035637
N/A patch:
vim-patch:58f1e5c0893a
This commit is contained in:
@@ -444,6 +444,27 @@ int buf_write_all(buf_T *buf, bool forceit)
|
||||
/// ":argdo", ":windo", ":bufdo", ":tabdo", ":cdo", ":ldo", ":cfdo" and ":lfdo"
|
||||
void ex_listdo(exarg_T *eap)
|
||||
{
|
||||
if (curwin->w_p_wfb) {
|
||||
if ((eap->cmdidx == CMD_ldo || eap->cmdidx == CMD_lfdo) && !eap->forceit) {
|
||||
// Disallow :ldo if 'winfixbuf' is applied
|
||||
semsg("%s", e_winfixbuf_cannot_go_to_buffer);
|
||||
return;
|
||||
}
|
||||
|
||||
if (win_valid(prevwin)) {
|
||||
// Change the current window to another because 'winfixbuf' is enabled
|
||||
curwin = prevwin;
|
||||
} else {
|
||||
// Split the window, which will be 'nowinfixbuf', and set curwin to that
|
||||
exarg_T new_eap = {
|
||||
.cmdidx = CMD_split,
|
||||
.cmd = "split",
|
||||
.arg = "",
|
||||
};
|
||||
ex_splitview(&new_eap);
|
||||
}
|
||||
}
|
||||
|
||||
char *save_ei = NULL;
|
||||
|
||||
// Temporarily override SHM_OVER and SHM_OVERALL to avoid that file
|
||||
|
Reference in New Issue
Block a user