Mercurial > vim
comparison src/autocmd.c @ 34383:a84fe48ae523 v9.1.0118
patch 9.1.0118: Use different restoration strategy in win_splitmove
Commit: https://github.com/vim/vim/commit/704966c2545897dfcf426dd9ef946aeb6fa80c38
Author: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Date: Tue Feb 20 22:00:33 2024 +0100
patch 9.1.0118: Use different restoration strategy in win_splitmove
Problem: saving and restoring all frames to split-move is overkill now
that WinNewPre is not fired when split-moving.
Solution: defer the flattening of frames until win_split_ins begins
reorganising them, and attempt to restore the layout by
undoing our changes. (Sean Dewar)
This also means we no longer must allocate.
related: #14042
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, 20 Feb 2024 22:30:07 +0100 |
parents | 37b4c89ba420 |
children | 172f30203d25 |
comparison
equal
deleted
inserted
replaced
34382:17d926feeb82 | 34383:a84fe48ae523 |
---|---|
1605 // Prevent chdir() call in win_enter_ext(), through do_autochdir(). | 1605 // Prevent chdir() call in win_enter_ext(), through do_autochdir(). |
1606 save_acd = p_acd; | 1606 save_acd = p_acd; |
1607 p_acd = FALSE; | 1607 p_acd = FALSE; |
1608 #endif | 1608 #endif |
1609 | 1609 |
1610 (void)win_split_ins(0, WSP_TOP | WSP_FORCE_ROOM, auc_win, 0); | 1610 (void)win_split_ins(0, WSP_TOP | WSP_FORCE_ROOM, auc_win, 0, NULL); |
1611 (void)win_comp_pos(); // recompute window positions | 1611 (void)win_comp_pos(); // recompute window positions |
1612 p_ea = save_ea; | 1612 p_ea = save_ea; |
1613 #ifdef FEAT_AUTOCHDIR | 1613 #ifdef FEAT_AUTOCHDIR |
1614 p_acd = save_acd; | 1614 p_acd = save_acd; |
1615 #endif | 1615 #endif |
1668 // Do not stop Insert mode when already in Insert mode before. | 1668 // Do not stop Insert mode when already in Insert mode before. |
1669 if (aco->save_State & MODE_INSERT) | 1669 if (aco->save_State & MODE_INSERT) |
1670 stop_insert_mode = save_stop_insert_mode; | 1670 stop_insert_mode = save_stop_insert_mode; |
1671 #endif | 1671 #endif |
1672 // Remove the window and frame from the tree of frames. | 1672 // Remove the window and frame from the tree of frames. |
1673 (void)winframe_remove(curwin, &dummy, NULL); | 1673 (void)winframe_remove(curwin, &dummy, NULL, NULL); |
1674 win_remove(curwin, NULL); | 1674 win_remove(curwin, NULL); |
1675 | 1675 |
1676 // The window is marked as not used, but it is not freed, it can be | 1676 // The window is marked as not used, but it is not freed, it can be |
1677 // used again. | 1677 // used again. |
1678 aucmd_win[aco->use_aucmd_win_idx].auc_win_used = FALSE; | 1678 aucmd_win[aco->use_aucmd_win_idx].auc_win_used = FALSE; |