Mercurial > vim
comparison src/evalwindow.c @ 34385:2f1489b02823 v9.1.0119
patch 9.1.0119: can move away from cmdwin using win_splitmove()
Commit: https://github.com/vim/vim/commit/f865895c874b0936b0563ebfef7490aac8cb8a1f
Author: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Date: Tue Feb 20 22:05:10 2024 +0100
patch 9.1.0119: can move away from cmdwin using win_splitmove()
Problem: can switch windows while textlocked via f_win_gotoid and
f_win_splitmove (which also allows switching in the cmdwin).
Solution: Check text_or_buf_locked in f_win_splitmove()
(Sean Dewar)
While at it, call text_or_buf_locked() in f_win_gotoid() instead of
testing for cmdwin_type() (which text_buf_locked() does and
in addition will also verify that the buffer is not locked).
closes: #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:08 +0100 |
parents | 37b4c89ba420 |
children | 8c4339d56b1b |
comparison
equal
deleted
inserted
replaced
34384:1e826423694b | 34385:2f1489b02823 |
---|---|
822 | 822 |
823 if (in_vim9script() && check_for_number_arg(argvars, 0) == FAIL) | 823 if (in_vim9script() && check_for_number_arg(argvars, 0) == FAIL) |
824 return; | 824 return; |
825 | 825 |
826 id = tv_get_number(&argvars[0]); | 826 id = tv_get_number(&argvars[0]); |
827 if (cmdwin_type != 0) | 827 if (text_or_buf_locked()) |
828 { | 828 return; |
829 emsg(_(e_invalid_in_cmdline_window)); | |
830 return; | |
831 } | |
832 #if defined(FEAT_PROP_POPUP) && defined(FEAT_TERMINAL) | 829 #if defined(FEAT_PROP_POPUP) && defined(FEAT_TERMINAL) |
833 if (popup_is_popup(curwin) && curbuf->b_term != NULL) | 830 if (popup_is_popup(curwin) && curbuf->b_term != NULL) |
834 { | 831 { |
835 emsg(_(e_not_allowed_for_terminal_in_popup_window)); | 832 emsg(_(e_not_allowed_for_terminal_in_popup_window)); |
836 return; | 833 return; |
996 flags |= tv_get_bool(&di->di_tv) ? WSP_BELOW : WSP_ABOVE; | 993 flags |= tv_get_bool(&di->di_tv) ? WSP_BELOW : WSP_ABOVE; |
997 size = (int)dict_get_number(d, "size"); | 994 size = (int)dict_get_number(d, "size"); |
998 } | 995 } |
999 | 996 |
1000 // Check if we can split the target before we bother switching windows. | 997 // Check if we can split the target before we bother switching windows. |
1001 if (check_split_disallowed(targetwin) == FAIL) | 998 if (text_or_buf_locked() || check_split_disallowed(targetwin) == FAIL) |
1002 return; | 999 return; |
1003 | 1000 |
1004 if (curwin != targetwin) | 1001 if (curwin != targetwin) |
1005 win_goto(targetwin); | 1002 win_goto(targetwin); |
1006 | 1003 |