aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/window.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-04-16 17:44:14 +0800
committerGitHub <noreply@github.com>2023-04-16 17:44:14 +0800
commitb28683d25281847716ca0003cecedb3f3a34d089 (patch)
treeab5e93ad8c642af51d209bafb372e48134d7a210 /src/nvim/window.c
parentc54592bfdacf08823a03d5aa251f49b906f3157d (diff)
downloadrneovim-b28683d25281847716ca0003cecedb3f3a34d089.tar.gz
rneovim-b28683d25281847716ca0003cecedb3f3a34d089.tar.bz2
rneovim-b28683d25281847716ca0003cecedb3f3a34d089.zip
vim-patch:9.0.0947: invalid memory access in substitute with function (#23126)
Problem: Invalid memory access in substitute with function that goes to another file. Solution: Check for text locked in CTRL-W gf. https://github.com/vim/vim/commit/cc762a48d42b579fb7bdec2c614636b830342dd5 Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r--src/nvim/window.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 75fa61fb1e..a2e1d1ab04 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -504,6 +504,9 @@ newwindow:
case Ctrl_F: {
wingotofile:
CHECK_CMDWIN;
+ if (check_text_or_curbuf_locked(NULL)) {
+ break;
+ }
linenr_T lnum = -1;
char *ptr = grab_file_name(Prenum1, &lnum);
@@ -1068,10 +1071,10 @@ int win_split(int size, int flags)
return win_split_ins(size, flags, NULL, 0);
}
-// When "new_wp" is NULL: split the current window in two.
-// When "new_wp" is not NULL: insert this window at the far
-// top/left/right/bottom.
-// return FAIL for failure, OK otherwise
+/// When "new_wp" is NULL: split the current window in two.
+/// When "new_wp" is not NULL: insert this window at the far
+/// top/left/right/bottom.
+/// @return FAIL for failure, OK otherwise
int win_split_ins(int size, int flags, win_T *new_wp, int dir)
{
win_T *wp = new_wp;