aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/normal.c2
-rw-r--r--src/nvim/window.c11
2 files changed, 8 insertions, 5 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index 718c51deb0..5fcdf5d4c1 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -462,7 +462,7 @@ static bool check_text_locked(oparg_T *oap)
/// If text is locked, "curbuf->b_ro_locked" or "allbuf_lock" is set:
/// Give an error message, possibly beep and return true.
/// "oap" may be NULL.
-static bool check_text_or_curbuf_locked(oparg_T *oap)
+bool check_text_or_curbuf_locked(oparg_T *oap)
{
if (check_text_locked(oap)) {
return true;
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;